PHP code example of oleant / laravel-visit-analytics
1. Go to this page and download the library: Download oleant/laravel-visit-analytics 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/ */
use Illuminate\Support\Facades\Schedule;
Schedule::command('visit-analytics:analyze-bots --max=500')->everyTenMinutes();
use Oleant\VisitAnalytics\Models\VisitLog;
// Get latest human visits
$visits = VisitLog::where('is_bot', false)->latest()->paginate(50);
// Get identified bots
$bots = VisitLog::where('is_bot', true)->latest()->get();