public function loginUser(User $user): bool
    {

        // If this account is disabled, refuse to login
        if (! $user->active) {

            event('security.log', [
                'Login for ' . $user->name . ' refused due to a disabled account', 'authentication',
            ]);

            return false;
        }

        auth()->login($user, true);

        return true;
    }
public function loginUser(User $user): bool
    {

        // If this account is disabled, refuse to login
        if (! $user->active) {

            event('security.log', [
                'Login for ' . $user->name . ' refused due to a disabled account', 'authentication',
            ]);

            return false;
        }

        auth()->login($user, true);

        return true;
    }
public function loginUser ( User $ user ) : bool { // If this account is disabled, refuse to login if ( ! $ user -> active ) { event ( 'security.log' , [ 'Login for ' . $ user -> name . ' refused due to a disabled account' , 'authentication' , ] ) ; return false ; } auth ( ) -> login ( $ user , true ) ; return true ; }
Login the user, ensuring that a group is attached.

If no group is attached, ensure that the user at least
has *a* group attached to it.

This method returns a boolean as a status flag for the
login routine. If a false is returned, it might mean
that that account is not allowed to sign in.

@param \Seat\Web\Models\User $user

@return bool
Login the user ensuring that a group is attached .