laraveleg\user-online

Define the status of the user that was online or otherwise.

Banner

Install via composer

Add orm to composer.json configuration file.

$ composer require laraveleg/user-online

add new middleware in app/Http/Kernel.php file

\LaravelEG\Laravel\Middleware\UserOnlineMiddleware::class

add the trait in your model User in app/User.php file

use LaravelEG\Laravel\Traits\UserOnline;

class User extends Authenticatable
{
    use UserOnline;
    ...

Functions

isOnline

Auth::user()->isOnline();

THX.