1. Go to this page and download the library: Download masoudi/laravel-visitors 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/ */
masoudi / laravel-visitors example snippets
use Masoudi\Laravel\Visitors\Contracts\Visitable;
use Masoudi\Laravel\Visitors\Traits\InteractsWithVisitors;
class Article extends Model implements Visitable
{
use InteractsWithVisitors;
}
$totalVisits = visitors()->count();
// Get ip unique count
$totalUniqueVisits = visitors()->uniqueCount();