public static function handle(LogoutEvent $event)
    {

        // If there is no user, do nothing.
        if (! $event->user)
            return;

        $event->user->login_history()->save(new UserLoginHistory([
            'source'     => Request::getClientIp(),
            'user_agent' => Request::header('User-Agent'),
            'action'     => 'logout',
        ]));

        $message = 'User logged out from ' . Request::getClientIp();
        event('security.log', [$message, 'authentication']);
    }
public static function handle(LogoutEvent $event)
    {

        // If there is no user, do nothing.
        if (! $event->user)
            return;

        $event->user->login_history()->save(new UserLoginHistory([
            'source'     => Request::getClientIp(),
            'user_agent' => Request::header('User-Agent'),
            'action'     => 'logout',
        ]));

        $message = 'User logged out from ' . Request::getClientIp();
        event('security.log', [$message, 'authentication']);
    }
public static function handle ( LogoutEvent $ event ) { // If there is no user, do nothing. if ( ! $ event -> user ) return ; $ event -> user -> login_history ( ) -> save ( new UserLoginHistory ( [ 'source' => Request :: getClientIp ( ) , 'user_agent' => Request :: header ( 'User-Agent' ) , 'action' => 'logout' , ] ) ) ; $ message = 'User logged out from ' . Request :: getClientIp ( ) ; event ( 'security.log' , [ $ message , 'authentication' ] ) ; }
Write a logout history item for this user.

@param \Illuminate\Auth\Events\Logout $event
Write a logout history item for this user .