trait InteractsWithAuthentication

Methods

actingAs(Authenticatable $user, string|null $guard = null)

Set the currently logged in user for the application.

actingAsGuest(string|null $guard = null)

Clear the currently logged in user for the application.

be(Authenticatable $user, string|null $guard = null)

Set the currently logged in user for the application.

assertAuthenticated(string|null $guard = null)

Assert that the user is authenticated.

assertGuest(string|null $guard = null)

Assert that the user is not authenticated.

bool
isAuthenticated(string|null $guard = null)

Return true if the user is authenticated, false otherwise.

assertAuthenticatedAs(Authenticatable $user, string|null $guard = null)

Assert that the user is authenticated as the given user.

assertCredentials(array $credentials, string|null $guard = null)

Assert that the given credentials are valid.

assertInvalidCredentials(array $credentials, string|null $guard = null)

Assert that the given credentials are invalid.

bool
hasCredentials(array $credentials, string|null $guard = null)

Return true if the credentials are valid, false otherwise.

Details

at line 14
InteractsWithAuthentication actingAs(Authenticatable $user, string|null $guard = null)

Set the currently logged in user for the application.

Parameters

Authenticatable $user
string|null $guard

Return Value

InteractsWithAuthentication

at line 22
InteractsWithAuthentication actingAsGuest(string|null $guard = null)

Clear the currently logged in user for the application.

Parameters

string|null $guard

Return Value

InteractsWithAuthentication

at line 36
InteractsWithAuthentication be(Authenticatable $user, string|null $guard = null)

Set the currently logged in user for the application.

Parameters

Authenticatable $user
string|null $guard

Return Value

InteractsWithAuthentication

at line 54
InteractsWithAuthentication assertAuthenticated(string|null $guard = null)

Assert that the user is authenticated.

Parameters

string|null $guard

Return Value

InteractsWithAuthentication

at line 64
InteractsWithAuthentication assertGuest(string|null $guard = null)

Assert that the user is not authenticated.

Parameters

string|null $guard

Return Value

InteractsWithAuthentication

at line 74
protected bool isAuthenticated(string|null $guard = null)

Return true if the user is authenticated, false otherwise.

Parameters

string|null $guard

Return Value

bool

at line 82
InteractsWithAuthentication assertAuthenticatedAs(Authenticatable $user, string|null $guard = null)

Assert that the user is authenticated as the given user.

Parameters

Authenticatable $user
string|null $guard

Return Value

InteractsWithAuthentication

at line 106
InteractsWithAuthentication assertCredentials(array $credentials, string|null $guard = null)

Assert that the given credentials are valid.

Parameters

array $credentials
string|null $guard

Return Value

InteractsWithAuthentication

at line 119
InteractsWithAuthentication assertInvalidCredentials(array $credentials, string|null $guard = null)

Assert that the given credentials are invalid.

Parameters

array $credentials
string|null $guard

Return Value

InteractsWithAuthentication

at line 132
protected bool hasCredentials(array $credentials, string|null $guard = null)

Return true if the credentials are valid, false otherwise.

Parameters

array $credentials
string|null $guard

Return Value

bool