InteractsWithAuthentication
Table of Contents
- actingAs() : $this
- Set the currently logged in user for the application.
- assertAuthenticated() : $this
- Assert that the user is authenticated.
- assertAuthenticatedAs() : $this
- Assert that the user is authenticated as the given user.
- assertCredentials() : $this
- Assert that the given credentials are valid.
- assertGuest() : $this
- Assert that the user is not authenticated.
- assertInvalidCredentials() : $this
- Assert that the given credentials are invalid.
- be() : void
- Set the currently logged in user for the application.
- hasCredentials() : bool
- Return true if the credentials are valid, false otherwise.
- isAuthenticated() : bool
- Return true if the user is authenticated, false otherwise.
Methods
actingAs()
Set the currently logged in user for the application.
public
actingAs(Authenticatable $user[, string|null $driver = null ]) : $this
Parameters
- $user : Authenticatable
- $driver : string|null = null
Return values
$this —assertAuthenticated()
Assert that the user is authenticated.
public
assertAuthenticated([string|null $guard = null ]) : $this
Parameters
- $guard : string|null = null
Return values
$this —assertAuthenticatedAs()
Assert that the user is authenticated as the given user.
public
assertAuthenticatedAs(Authenticatable $user[, string|null $guard = null ]) : $this
Parameters
- $user : Authenticatable
- $guard : string|null = null
Return values
$this —assertCredentials()
Assert that the given credentials are valid.
public
assertCredentials(array<string|int, mixed> $credentials[, string|null $guard = null ]) : $this
Parameters
- $credentials : array<string|int, mixed>
- $guard : string|null = null
Return values
$this —assertGuest()
Assert that the user is not authenticated.
public
assertGuest([string|null $guard = null ]) : $this
Parameters
- $guard : string|null = null
Return values
$this —assertInvalidCredentials()
Assert that the given credentials are invalid.
public
assertInvalidCredentials(array<string|int, mixed> $credentials[, string|null $guard = null ]) : $this
Parameters
- $credentials : array<string|int, mixed>
- $guard : string|null = null
Return values
$this —be()
Set the currently logged in user for the application.
public
be(Authenticatable $user[, string|null $driver = null ]) : void
Parameters
- $user : Authenticatable
- $driver : string|null = null
Return values
void —hasCredentials()
Return true if the credentials are valid, false otherwise.
protected
hasCredentials(array<string|int, mixed> $credentials[, string|null $guard = null ]) : bool
Parameters
- $credentials : array<string|int, mixed>
- $guard : string|null = null
Return values
bool —isAuthenticated()
Return true if the user is authenticated, false otherwise.
protected
isAuthenticated([string|null $guard = null ]) : bool
Parameters
- $guard : string|null = null