PHP code example of rinvex / laravel-statistics

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

    

rinvex / laravel-statistics example snippets


// Find first browser agent (any of these methods are valid and equivalent)
app('rinvex.statistics.agent')->first();
new \Rinvex\Statistics\Models\Agent::first();
app(\Rinvex\Statistics\Contracts\AgentContract::class)->first();

$pageViews = app('rinvex.statistics.path')->where('path', request()->decodedPath())->first()->count;
shell
    php artisan rinvex:publish:statistics
    
shell
    php artisan rinvex:migrate:statistics
    

    php artisan rinvex:publish:statistics