PHP code example of kitoko / visitor-tracker

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

    

kitoko / visitor-tracker example snippets


php artisan vendor:publish --tag=visitor-tracker-config

config/visitor-tracker.php
`
php artisan migrate

return [
    'enabled' => true,
    'retention_days' => 30,
    'cache_minutes' => 10,
];

use Kitoko\VisitorTracker\Facades\VisitorTracker;

public function index()
{
    $stats = [
        'total' => VisitorTracker::total(),
        'today' => VisitorTracker::today(),
        'week'  => VisitorTracker::week(),
    ];

    return view('dashboard', compact('stats'));
}
 
composer dump-autoload 

$this->loadMigrationsFrom(__DIR__.'/../database/migrations');