Looking to hire Laravel developers? Try LaraJobs

laravel-user-online maintained by komicho

Description
Analyze packages within the project
Author
Last update
2023/09/29 22:58 (dev-dependabot/composer/composer/composer-2.6.4)
Downloads
192
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.