Guard
class Guard
Properties
| static protected array<class-string, mixed> | $defaultGuardNames | ||
| static protected Model>, string> | $modelKeyNames | ||
| static protected array<string, null|Model>> | $providerModels | ||
| static protected array<class-string, array<int, string>> | $configAuthGuards | ||
| static protected array<string, null|Model>> | $modelsForGuards |
Methods
Get the model class associated with a given provider.
Get the default guard_name property for a model class.
Get the config repository.
Normalize an optional guard name.
Get the configured auth guards.
Get list of relevant guards for the $class model based on config(auth) settings.
Get the model associated with a given guard name.
Get a model's key name without repeatedly constructing the model.
Lookup a guard name relevant for the $class model and the current user.
Lookup a Passport guard.
Flush all static state.
Details
at line 46
static Collection
getNames(string|Model $model)
Return a collection of guard names suitable for the model, as indicated by the presence of a $guard_name property or a guardName() method on the model.
at line 74
static protected string|null
getProviderModel(string $provider)
Get the model class associated with a given provider.
at line 99
static protected mixed
getDefaultGuardNameProperty(string $class)
Get the default guard_name property for a model class.
at line 111
static protected Repository
config()
Get the config repository.
at line 119
static protected Factory
auth()
Get the auth factory.
at line 127
static string|null
normalizeName(string|null $guard)
Normalize an optional guard name.
at line 137
static protected array
guards()
Get the configured auth guards.
at line 151
static protected Collection
getConfigAuthGuards(string $class)
Get list of relevant guards for the $class model based on config(auth) settings.
Lookup flow:
- get names of models for guards defined in auth.guards where a provider is set
- filter for provider models matching the model $class being checked
- keys() gives just the names of the matched guards
- return collection of guard names
at line 178
static string|null
getModelForGuard(string $guard)
Get the model associated with a given guard name.
at line 199
static string
getModelKeyName(string $modelClass)
Get a model's key name without repeatedly constructing the model.
at line 207
static string
getDefaultName(string|Model $class)
Lookup a guard name relevant for the $class model and the current user.
at line 225
static Authorizable|null
getPassportClient(string|null $guard)
Lookup a Passport guard.
at line 257
static void
flushState()
Flush all static state.