PHP code example of acelords / laravel-users-online

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

    

acelords / laravel-users-online example snippets



class User extends Authenticatable
{
    use \HighIdeas\UsersOnline\Traits\UsersOnlineTrait;
...


$user = new User;
$user->allOnline();

$user = User::find($id);
$user->isOnline();

$user = new User;
$user->mostRecentOnline();
$user->leastRecentOnline();

use Facades\App\User as UserFacade;

UserFacade::mostRecentOnline();
UserFacade::leastRecentOnline();