Looking to hire Laravel developers? Try LaraJobs

user-online maintained by laraveleg

Description
Analyze packages within the project
Author
Last update
2021/08/23 08:47 (dev-master)
Downloads
129
Tags

Comments
comments powered by Disqus

laraveleg\user-online

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

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.