public static function handle(LoginEvent $event)
    {

        // Create a log entry for this login.
        $event->user->last_login_source = Request::getClientIp();
        $event->user->last_login = new DateTime();
        $event->user->save();

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

        $message = 'User logged in from ' . Request::getClientIp();
        event('security.log', [$message, 'authentication']);

        if ($event->user->refresh_token()->exists()) {

            // Update Character information
            (new CharacterTokenShouldUpdate($event->user->refresh_token, 'high'))->fire();

            // Update Corporation information
            (new CorporationTokenShouldUpdate($event->user->refresh_token, 'high'))->fire();
        }
    }
public static function handle(LoginEvent $event)
    {

        // Create a log entry for this login.
        $event->user->last_login_source = Request::getClientIp();
        $event->user->last_login = new DateTime();
        $event->user->save();

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

        $message = 'User logged in from ' . Request::getClientIp();
        event('security.log', [$message, 'authentication']);

        if ($event->user->refresh_token()->exists()) {

            // Update Character information
            (new CharacterTokenShouldUpdate($event->user->refresh_token, 'high'))->fire();

            // Update Corporation information
            (new CorporationTokenShouldUpdate($event->user->refresh_token, 'high'))->fire();
        }
    }
public static function handle ( LoginEvent $ event ) { // Create a log entry for this login. $ event -> user -> last_login_source = Request :: getClientIp ( ) ; $ event -> user -> last_login = new DateTime ( ) ; $ event -> user -> save ( ) ; $ event -> user -> login_history ( ) -> save ( new UserLoginHistory ( [ 'source' => Request :: getClientIp ( ) , 'user_agent' => Request :: header ( 'User-Agent' ) , 'action' => 'login' , ] ) ) ; $ message = 'User logged in from ' . Request :: getClientIp ( ) ; event ( 'security.log' , [ $ message , 'authentication' ] ) ; if ( $ event -> user -> refresh_token ( ) -> exists ( ) ) { // Update Character information ( new CharacterTokenShouldUpdate ( $ event -> user -> refresh_token , 'high' ) ) -> fire ( ) ; // Update Corporation information ( new CorporationTokenShouldUpdate ( $ event -> user -> refresh_token , 'high' ) ) -> fire ( ) ; } }
Update the last login values and write a new
login history item.

@param \Illuminate\Auth\Events\Login $event
Update the last login values and write a new login history item .