public function updateFields(Guard $auth, $ip = null): bool
    {
        $ip = $this->setIpValue($ip);

        $user = $auth->user();

        if (!$user instanceof Model) {
            return false;
        }
        $user->last_login_ip = $ip;

        $lastLoginDate = config('iptraceable.fields.last_login_date');

        if (!is_null($lastLoginDate)) {
            $user->{$lastLoginDate} = Carbon::now();
        }

        return $user->save();
    }
public function updateFields(Guard $auth, $ip = null): bool
    {
        $ip = $this->setIpValue($ip);

        $user = $auth->user();

        if (!$user instanceof Model) {
            return false;
        }
        $user->last_login_ip = $ip;

        $lastLoginDate = config('iptraceable.fields.last_login_date');

        if (!is_null($lastLoginDate)) {
            $user->{$lastLoginDate} = Carbon::now();
        }

        return $user->save();
    }
public function updateFields ( Guard $ auth , $ ip = null ) : bool { $ ip = $ this -> setIpValue ( $ ip ) ; $ user = $ auth -> user ( ) ; if ( ! $ user instanceof Model ) { return false ; } $ user -> last_login_ip = $ ip ; $ lastLoginDate = config ( 'iptraceable.fields.last_login_date' ) ; if ( ! is_null ( $ lastLoginDate ) ) { $ user -> { $ lastLoginDate } = Carbon :: now ( ) ; } return $ user -> save ( ) ; }
Update the fields for the user.

@param \Illuminate\Contracts\Auth\Guard $auth
@param null|string $ip The IP to set.

@return bool
Update the fields for the user .