PHP code example of tusharthe / online-users-laravel

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

    

tusharthe / online-users-laravel example snippets

 
    tusharthe\OnlineUsers\OnlineUsersServiceProvider::class,

  \tusharthe\OnlineUsers\Middleware\UsersOnline::class,


class User extends Authenticatable
{
       use \tusharthe\OnlineUsers\Library\OnlineUsers;       
...
}


        'Illuminate\Auth\Events\Logout' => [
            'tusharthe\OnlineUsers\Listeners\LogoutListener',
        ],

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

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