On this page
Middleware
class Middleware (View source)
Properties
Closure|string|array | $middleware | The middleware that should be assigned. |
|
array|null | $only | The controller methods the middleware should only apply to. |
|
array|null | $except | The controller methods the middleware should not apply to. |
Methods
void | __construct(Closure|string|array $middleware) Create a new controller middleware definition. |
|
$this | only(array|string $only) Specify the only controller methods the middleware should apply to. |
|
$this | except(array|string $except) Specify the controller methods the middleware should not apply to. |
Details
void __construct(Closure|string|array $middleware)
Create a new controller middleware definition.
$this only(array|string $only)
Specify the only controller methods the middleware should apply to.
$this except(array|string $except)
Specify the controller methods the middleware should not apply to.
© Taylor Otwell
Licensed under the MIT License.
Laravel is a trademark of Taylor Otwell.
https://laravel.com/api/10.x/Illuminate/Routing/Controllers/Middleware.html