PHP code example of stounhandj / laravel-traffic-metrics

1. Go to this page and download the library: Download stounhandj/laravel-traffic-metrics 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/ */

    

stounhandj / laravel-traffic-metrics example snippets


StounhandJ\LaravelTrafficMetrics\TrafficMetricsProvider::class,

'metrics' => \StounhandJ\LaravelTrafficMetrics\Middleware\MetricsMiddleware::class,

Route::get('/p/{product:id}', [ProductController::class, "index"])
    ->middleware("metrics")
    ->name("product.details");

Metrics::findByUri("/welcome")->getViews() 
shell
php artisan vendor:publish --tag=traffic-metrics
php artisan vendor:publish --tag=laravel-kafka-config
shell
php artisan migrate
shell
php artisan metrics:check