PHP code example of rukhsar / laravel-active-route

1. Go to this page and download the library: Download rukhsar/laravel-active-route library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

rukhsar / laravel-active-route example snippets


Rukhsar\ActiveRoute\ActiveRouteServiceProvider::class,

'Active'    =>  Rukhsar\ActiveRoute\Facades\Active::class,

return [

    // The default css class value if the request match given route name
    'class' => 'active',

];


Active::route('route.name'); // Facade example
app('active')->route('route.name'); // Application container example
active_route('route.name'); // Helper function

// Wildcard exmaples

Active::route('route.name.*');
active_route('route.name.*');

// Multiple Routes

Active::route(['route.name1.*', 'route.name2.*']);
active_route(['route.name1.*', 'route.name2.*']);

php artisan vendor:publish --provider="Rukhsar\ActiveRoute\ActiveRouteServiceProvider" --tag="config"