Level 102
No it's correct. It get assigned a simple name here https://github.com/laravel/laravel/blob/9.x/app/Http/Kernel.php#L56
1 like
Be part of JetBrains PHPverse 2026 on June 9 β a free online event bringing PHP devs worldwide together.
From the Middleware page:
https://laravel.com/docs/9.x/middleware#middleware-parameters
They give example with a class called EnsureUserHasRole
Then they say:
Middleware parameters may be specified when defining the route by separating the middleware name and parameters with a :. Multiple parameters should be delimited by commas:
Route::put('/post/{id}', function ($id) {
//
})->middleware('role:editor');
But shouldn't it be:
->middleware('EnsureUserHasRole:editor')
No it's correct. It get assigned a simple name here https://github.com/laravel/laravel/blob/9.x/app/Http/Kernel.php#L56
Please or to participate in this conversation.