PHP code example of muhammad-nawlo / route-tracker

1. Go to this page and download the library: Download muhammad-nawlo/route-tracker 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/ */

    

muhammad-nawlo / route-tracker example snippets


// bootstrap/app.php (Laravel 11+)
->withMiddleware(function (Middleware $middleware) {
    $middleware->api(append: [
        \MuhammadNawlo\RouteTracker\Middleware\TrackRouteUsage::class,
    ]);
})

// config/route-tracker.php
return [
    'enabled' => env('ROUTE_TRACKER_ENABLED', true),
];
bash
php artisan vendor:publish --provider="MuhammadNawlo\RouteTracker\RouteTrackerServiceProvider" --tag=config
bash
php artisan route:usage