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 34
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 50
InteractsWithAuthentication assertAuthenticated(string|null $guard = null)

Assert that the user is authenticated.

Parameters

string|null $guard

Return Value

InteractsWithAuthentication

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

Assert that the user is not authenticated.

Parameters

string|null $guard

Return Value

InteractsWithAuthentication

at line 70
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 78
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 102
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 115
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 128
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