PHP code example of highideas / laravel-users-online

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

    

highideas / 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();