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 100
static protected mixed
getDefaultGuardNameProperty(string $class)
Get the default guard_name property for a model class.
at line 112
static protected Repository
config()
Get the config repository.
at line 120
static protected Factory
auth()
Get the auth factory.
at line 128
static string|null
normalizeName(string|null $guard)
Normalize an optional guard name.
at line 138
static protected array
guards()
Get the configured auth guards.
at line 152
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 181
static string|null
getModelForGuard(string $guard)
Get the model associated with a given guard name.
at line 203
static string
getModelKeyName(string $modelClass)
Get a model's key name without repeatedly constructing the model.
at line 211
static string
getDefaultName(string|Model $class)
Lookup a guard name relevant for the $class model and the current user.
at line 230
static Authorizable|null
getPassportClient(string|null $guard)
Lookup a Passport guard.
at line 262
static void
flushState()
Flush all static state.