laraveleg/user-online

There is no license information available for the latest version (1.2) of this package.

Analyze packages within the project

1.2 2021-08-23 06:47 UTC

This package is auto-updated.

Last update: 2024-10-29 23:15:07 UTC


README

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.