public function updateUserRecordWithLastlogin($userId) {

        $now = Carbon::now();
        $ip  = $this->request->getClientIp();

        DB::table('users')
            ->where('id', $userId)
            ->update(['last_login' => $now, 'last_login_ip' => $ip] )
        ;
    }
public function updateUserRecordWithLastlogin($userId) {

        $now = Carbon::now();
        $ip  = $this->request->getClientIp();

        DB::table('users')
            ->where('id', $userId)
            ->update(['last_login' => $now, 'last_login_ip' => $ip] )
        ;
    }
public function updateUserRecordWithLastlogin ( $ userId ) { $ now = Carbon :: now ( ) ; $ ip = $ this -> request -> getClientIp ( ) ; DB :: table ( 'users' ) -> where ( 'id' , $ userId ) -> update ( [ 'last_login' => $ now , 'last_login_ip' => $ ip ] ) ; }
UPDATE the user record for fields "last_login" and "last_login_ip"

This method is here because it is convenient, as this class is already injected in the auth classes

@param  int    $userId          User ID
@return void
UPDATE the user record for fields last_login and last_login_ip