RequestGuard
in package
implements
Guard
Uses
GuardHelpers, Macroable
Interfaces, Classes and Traits
Table of Contents
- $callback : callable
- The guard callback.
- $macros : array<string|int, mixed>
- The registered string macros.
- $provider : UserProvider
- The user provider implementation.
- $request : Request
- The request instance.
- $user : Authenticatable
- The currently authenticated user.
- __call() : mixed
- Dynamically handle calls to the class.
- __callStatic() : mixed
- Dynamically handle calls to the class.
- __construct() : void
- Create a new authentication guard.
- authenticate() : Authenticatable
- Determine if the current user is authenticated.
- check() : bool
- Determine if the current user is authenticated.
- getProvider() : UserProvider
- Get the user provider used by the guard.
- guest() : bool
- Determine if the current user is a guest.
- hasMacro() : bool
- Checks if macro is registered.
- id() : int|null
- Get the ID for the currently authenticated user.
- macro() : void
- Register a custom macro.
- mixin() : void
- Mix another object into the class.
- setProvider() : void
- Set the user provider used by the guard.
- setRequest() : $this
- Set the current request instance.
- setUser() : $this
- Set the current user.
- user() : Authenticatable|null
- Get the currently authenticated user.
- validate() : bool
- Validate a user's credentials.
Properties
$callback
The guard callback.
protected
callable
$callback
$macros
The registered string macros.
protected
static array<string|int, mixed>
$macros
= []
$provider
The user provider implementation.
protected
UserProvider
$provider
$request
The request instance.
protected
Request
$request
$user
The currently authenticated user.
protected
Authenticatable
$user
Methods
__call()
Dynamically handle calls to the class.
public
__call(string $method, array<string|int, mixed> $parameters) : mixed
Parameters
- $method : string
- $parameters : array<string|int, mixed>
Tags
Return values
mixed —__callStatic()
Dynamically handle calls to the class.
public
static __callStatic(string $method, array<string|int, mixed> $parameters) : mixed
Parameters
- $method : string
- $parameters : array<string|int, mixed>
Tags
Return values
mixed —__construct()
Create a new authentication guard.
public
__construct(callable $callback, Request $request[, UserProvider|null $provider = null ]) : void
Parameters
- $callback : callable
- $request : Request
- $provider : UserProvider|null = null
Return values
void —authenticate()
Determine if the current user is authenticated.
public
authenticate() : Authenticatable
Tags
Return values
Authenticatable —check()
Determine if the current user is authenticated.
public
check() : bool
Return values
bool —getProvider()
Get the user provider used by the guard.
public
getProvider() : UserProvider
Return values
UserProvider —guest()
Determine if the current user is a guest.
public
guest() : bool
Return values
bool —hasMacro()
Checks if macro is registered.
public
static hasMacro(string $name) : bool
Parameters
- $name : string
Return values
bool —id()
Get the ID for the currently authenticated user.
public
id() : int|null
Return values
int|null —macro()
Register a custom macro.
public
static macro(string $name, object|callable $macro) : void
Parameters
- $name : string
- $macro : object|callable
Return values
void —mixin()
Mix another object into the class.
public
static mixin(object $mixin) : void
Parameters
- $mixin : object
Return values
void —setProvider()
Set the user provider used by the guard.
public
setProvider(UserProvider $provider) : void
Parameters
- $provider : UserProvider
Return values
void —setRequest()
Set the current request instance.
public
setRequest(Request $request) : $this
Parameters
- $request : Request
Return values
$this —setUser()
Set the current user.
public
setUser(Authenticatable $user) : $this
Parameters
- $user : Authenticatable
Return values
$this —user()
Get the currently authenticated user.
public
user() : Authenticatable|null
Return values
Authenticatable|null —validate()
Validate a user's credentials.
public
validate([array<string|int, mixed> $credentials = [] ]) : bool
Parameters
- $credentials : array<string|int, mixed> = []