AuthManager
in package
implements
Factory
Uses
CreatesUserProviders
Interfaces, Classes and Traits
Table of Contents
- $app : Application
- The application instance.
- $customCreators : array<string|int, mixed>
- The registered custom driver creators.
- $customProviderCreators : array<string|int, mixed>
- The registered custom provider creators.
- $guards : array<string|int, mixed>
- The array of created "drivers".
- $userResolver : Closure
- The user resolver shared by various services.
- __call() : mixed
- Dynamically call the default driver instance.
- __construct() : void
- Create a new Auth manager instance.
- createSessionDriver() : SessionGuard
- Create a session based authentication guard.
- createTokenDriver() : TokenGuard
- Create a token based authentication guard.
- createUserProvider() : UserProvider|null
- Create the user provider implementation for the driver.
- extend() : $this
- Register a custom driver creator Closure.
- getDefaultDriver() : string
- Get the default authentication driver name.
- getDefaultUserProvider() : string
- Get the default user provider name.
- guard() : Guard|StatefulGuard
- Attempt to get the guard from the local cache.
- provider() : $this
- Register a custom provider creator Closure.
- resolveUsersUsing() : $this
- Set the callback to be used to resolve users.
- setDefaultDriver() : void
- Set the default authentication driver name.
- shouldUse() : void
- Set the default guard driver the factory should serve.
- userResolver() : Closure
- Get the user resolver callback.
- viaRequest() : $this
- Register a new callback based request guard.
- callCustomCreator() : mixed
- Call a custom driver creator.
- createDatabaseProvider() : DatabaseUserProvider
- Create an instance of the database user provider.
- createEloquentProvider() : EloquentUserProvider
- Create an instance of the Eloquent user provider.
- getConfig() : array<string|int, mixed>
- Get the guard configuration.
- getProviderConfiguration() : array<string|int, mixed>|null
- Get the user provider configuration.
- resolve() : Guard|StatefulGuard
- Resolve the given guard.
Properties
$app
The application instance.
protected
Application
$app
$customCreators
The registered custom driver creators.
protected
array<string|int, mixed>
$customCreators
= []
$customProviderCreators
The registered custom provider creators.
protected
array<string|int, mixed>
$customProviderCreators
= []
$guards
The array of created "drivers".
protected
array<string|int, mixed>
$guards
= []
$userResolver
The user resolver shared by various services.
protected
Closure
$userResolver
Determines the default user for Gate, Request, and the Authenticatable contract.
Methods
__call()
Dynamically call the default driver instance.
public
__call(string $method, array<string|int, mixed> $parameters) : mixed
Parameters
- $method : string
- $parameters : array<string|int, mixed>
Return values
mixed —__construct()
Create a new Auth manager instance.
public
__construct(Application $app) : void
Parameters
- $app : Application
Return values
void —createSessionDriver()
Create a session based authentication guard.
public
createSessionDriver(string $name, array<string|int, mixed> $config) : SessionGuard
Parameters
- $name : string
- $config : array<string|int, mixed>
Return values
SessionGuard —createTokenDriver()
Create a token based authentication guard.
public
createTokenDriver(string $name, array<string|int, mixed> $config) : TokenGuard
Parameters
- $name : string
- $config : array<string|int, mixed>
Return values
TokenGuard —createUserProvider()
Create the user provider implementation for the driver.
public
createUserProvider([string|null $provider = null ]) : UserProvider|null
Parameters
- $provider : string|null = null
Tags
Return values
UserProvider|null —extend()
Register a custom driver creator Closure.
public
extend(string $driver, Closure $callback) : $this
Parameters
- $driver : string
- $callback : Closure
Return values
$this —getDefaultDriver()
Get the default authentication driver name.
public
getDefaultDriver() : string
Return values
string —getDefaultUserProvider()
Get the default user provider name.
public
getDefaultUserProvider() : string
Return values
string —guard()
Attempt to get the guard from the local cache.
public
guard([string $name = null ]) : Guard|StatefulGuard
Parameters
- $name : string = null
Return values
Guard|StatefulGuard —provider()
Register a custom provider creator Closure.
public
provider(string $name, Closure $callback) : $this
Parameters
- $name : string
- $callback : Closure
Return values
$this —resolveUsersUsing()
Set the callback to be used to resolve users.
public
resolveUsersUsing(Closure $userResolver) : $this
Parameters
- $userResolver : Closure
Return values
$this —setDefaultDriver()
Set the default authentication driver name.
public
setDefaultDriver(string $name) : void
Parameters
- $name : string
Return values
void —shouldUse()
Set the default guard driver the factory should serve.
public
shouldUse(string $name) : void
Parameters
- $name : string
Return values
void —userResolver()
Get the user resolver callback.
public
userResolver() : Closure
Return values
Closure —viaRequest()
Register a new callback based request guard.
public
viaRequest(string $driver, callable $callback) : $this
Parameters
- $driver : string
- $callback : callable
Return values
$this —callCustomCreator()
Call a custom driver creator.
protected
callCustomCreator(string $name, array<string|int, mixed> $config) : mixed
Parameters
- $name : string
- $config : array<string|int, mixed>
Return values
mixed —createDatabaseProvider()
Create an instance of the database user provider.
protected
createDatabaseProvider(array<string|int, mixed> $config) : DatabaseUserProvider
Parameters
- $config : array<string|int, mixed>
Return values
DatabaseUserProvider —createEloquentProvider()
Create an instance of the Eloquent user provider.
protected
createEloquentProvider(array<string|int, mixed> $config) : EloquentUserProvider
Parameters
- $config : array<string|int, mixed>
Return values
EloquentUserProvider —getConfig()
Get the guard configuration.
protected
getConfig(string $name) : array<string|int, mixed>
Parameters
- $name : string
Return values
array<string|int, mixed> —getProviderConfiguration()
Get the user provider configuration.
protected
getProviderConfiguration(string|null $provider) : array<string|int, mixed>|null
Parameters
- $provider : string|null
Return values
array<string|int, mixed>|null —resolve()
Resolve the given guard.
protected
resolve(string $name) : Guard|StatefulGuard
Parameters
- $name : string