komicho/laravel-user-online

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

Analyze packages within the project

dev-master 2019-02-24 20:35 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 komicho/laravel-user-online dev-master

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

\Komicho\Laravel\Middleware\UserOnlineMiddleware::class

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

use Komicho\Laravel\Traits\UserOnline;

class User extends Authenticatable
{
    use UserOnline;
    ...

Functions

isOnline

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

THX.