Irazasyed\JwtAuthGuard\JwtAuthGuard::attempt PHP Method

attempt() public method

Attempt to authenticate the user using the given credentials and return the token.
public attempt ( array $credentials = [], boolean $login = true ) : mixed
$credentials array
$login boolean
return mixed
    public function attempt(array $credentials = [], $login = true)
    {
        $this->lastAttempted = $user = $this->provider->retrieveByCredentials($credentials);
        if ($this->hasValidCredentials($user, $credentials)) {
            return $login ? $this->login($user) : true;
        }
        return false;
    }