Middleware
class Middleware (View source)
Properties
protected array | $global | The user defined global middleware stack. |
|
protected array | $prepends | The middleware that should be prepended to the global middleware stack. |
|
protected array | $appends | The middleware that should be appended to the global middleware stack. |
|
protected array | $removals | The middleware that should be removed from the global middleware stack. |
|
protected array | $replacements | The middleware that should be replaced in the global middleware stack. |
|
protected array | $groups | The user defined middleware groups. |
|
protected array | $groupPrepends | The middleware that should be prepended to the specified groups. |
|
protected array | $groupAppends | The middleware that should be appended to the specified groups. |
|
protected array | $groupRemovals | The middleware that should be removed from the specified groups. |
|
protected array | $groupReplacements | The middleware that should be replaced in the specified groups. |
|
protected array | $pageMiddleware | The Folio / page middleware for the application. |
|
protected bool | $trustHosts | Indicates if the "trust hosts" middleware is enabled. |
|
protected bool | $statefulApi | Indicates if Sanctum's frontend state middleware is enabled. |
|
protected string | $apiLimiter | Indicates the API middleware group's rate limiter. |
|
protected array | $throttleWithRedis | Indicates if Redis throttling should be applied. |
|
protected array | $aliases | The default middleware aliases. |
|
protected array | $customAliases | The custom middleware aliases. |
Methods
Prepend middleware to the application's global middleware stack.
Append middleware to the application's global middleware stack.
Remove middleware from the application's global middleware stack.
Specify a middleware that should be replaced with another middleware.
Define the global middleware for the application.
Define a middleware group.
Prepend the given middleware to the specified group.
Append the given middleware to the specified group.
Remove the given middleware from the specified group.
Replace the given middleware in the specified group with another middleware.
Modify the middleware in the "web" group.
Modify the middleware in the "api" group.
Modify the middleware in the given group.
Register the Folio / page middleware for the application.
Register additional middleware aliases.
Get the global middleware.
Get the middleware groups.
Configure the behavior of the authentication middleware.
Configure the behavior of the "guest" middleware.
Indicate that the trusted host middleware should be enabled.
Indicate that Sanctum's frontend state middleware should be enabled.
Indicate that the API middleware group's throttling middleware should be enabled.
Indicate that Laravel's throttling middleware should use Redis.
Get the Folio / page middleware for the application.
Get the middleware aliases.
Get the default middleware aliases.
Details
$this
prepend(array|string $middleware)
Prepend middleware to the application's global middleware stack.
$this
append(array|string $middleware)
Append middleware to the application's global middleware stack.
$this
remove(array|string $middleware)
Remove middleware from the application's global middleware stack.
$this
replace(string $search, string $replace)
Specify a middleware that should be replaced with another middleware.
$this
use(array $middleware)
Define the global middleware for the application.
$this
group(string $group, array $middleware)
Define a middleware group.
$this
prependToGroup(string $group, array|string $middleware)
Prepend the given middleware to the specified group.
$this
appendToGroup(string $group, array|string $middleware)
Append the given middleware to the specified group.
$this
removeFromGroup(string $group, array|string $middleware)
Remove the given middleware from the specified group.
$this
replaceInGroup(string $group, string $search, string $replace)
Replace the given middleware in the specified group with another middleware.
$this
web(array|string $append = [], array|string $prepend = [], array|string $remove = [], array $replace = [])
Modify the middleware in the "web" group.
$this
api(array|string $append = [], array|string $prepend = [], array|string $remove = [], array $replace = [])
Modify the middleware in the "api" group.
protected $this
modifyGroup(string $group, array|string $append, array|string $prepend, array|string $remove, array $replace)
Modify the middleware in the given group.
$this
pages(array $middleware)
Register the Folio / page middleware for the application.
$this
alias(array $aliases)
Register additional middleware aliases.
array
getGlobalMiddleware()
Get the global middleware.
array
getMiddlewareGroups()
Get the middleware groups.
$this
auth(callable $redirectTo)
Configure the behavior of the authentication middleware.
$this
guest(callable $redirectTo)
Configure the behavior of the "guest" middleware.
$this
withTrustedHosts()
Indicate that the trusted host middleware should be enabled.
$this
withStatefulApi()
Indicate that Sanctum's frontend state middleware should be enabled.
$this
withThrottledApi(string $limiter = 'api', bool $redis = false)
Indicate that the API middleware group's throttling middleware should be enabled.
$this
throttleWithRedis()
Indicate that Laravel's throttling middleware should use Redis.
array
getPageMiddleware()
Get the Folio / page middleware for the application.
array
getMiddlewareAliases()
Get the middleware aliases.
protected array
defaultAliases()
Get the default middleware aliases.