PHP code example of evanschleret / laravel-user-presence
1. Go to this page and download the library: Download evanschleret/laravel-user-presence 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/ */
evanschleret / laravel-user-presence example snippets
use EvanSchleret\LaravelUserPresence\Traits\HasUserPresence;
class User extends Authenticatable
{
use HasUserPresence;
}
// config/user-presence.php
return [
'online_threshold' => 300, // in seconds
'idle_threshold' => 600, // in seconds
'guard' => 'web', // or 'api' / 'sanctum' if using API authentication
];