Documentation

RequestGuard
in package
implements Guard Uses GuardHelpers, Macroable

Interfaces, Classes and Traits

Guard

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 = []

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
throws
BadMethodCallException
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
throws
BadMethodCallException
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

check()

Determine if the current user is authenticated.

public check() : bool
Return values
bool

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

setRequest()

Set the current request instance.

public setRequest(Request $request) : $this
Parameters
$request : Request
Return values
$this

validate()

Validate a user's credentials.

public validate([array<string|int, mixed> $credentials = [] ]) : bool
Parameters
$credentials : array<string|int, mixed> = []
Return values
bool

Search results