class JwtGuard extends GuardContract (View source)

Traits

Properties

protected string $guard

The define guard

from  GuardContract

Methods

mixed
id()

Get the user id

bool
check()

Check if user is authenticated

bool
guest()

Check if user is guest

bool
logout()

Destruct token

bool
login(Authentication $user)

Make direct login

Authentication|null
user()

Check if user is authenticated

bool
attempts(array $credentials)

Check if user is authenticated

string
getName()

Get the guard name

guard(string $guard = null)

Load the guard

__construct(array $provider, string $guard)

JwtGuard constructor.

Token|null
getToken()

Get the generated token

Details

mixed id()

Get the user id

Return Value

mixed

Exceptions

AuthenticationException

bool check()

Check if user is authenticated

Return Value

bool

Exceptions

Exception

bool guest()

Check if user is guest

Return Value

bool

Exceptions

Exception

bool logout()

Destruct token

Return Value

bool

bool login(Authentication $user)

Make direct login

Parameters

Authentication $user

Return Value

bool

Exceptions

Exception

Authentication|null user()

Check if user is authenticated

Return Value

Authentication|null

Exceptions

AuthenticationException
Exception

bool attempts(array $credentials)

Check if user is authenticated

Parameters

array $credentials

Return Value

bool

Exceptions

AuthenticationException
Exception

string getName()

Get the guard name

Return Value

string

GuardContract guard(string $guard = null)

Load the guard

Parameters

string $guard

Return Value

GuardContract

Exceptions

AuthenticationException

__construct(array $provider, string $guard)

JwtGuard constructor.

Parameters

array $provider
string $guard

Exceptions

AuthenticationException

Token|null getToken()

Get the generated token

Return Value

Token|null