Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

FounderStartup's avatar

Middleware with multiple roles not working

What is the correct syntax for the following route group ? The second role is not working with this code. Any help ?

Route::group(['middleware' => ['auth', 'role:broker, individual' ]], function () {
0 likes
1 reply
vimalkaul's avatar
Level 4

The correct syntax is

Route::middleware(['web', 'auth'])->group(function () {
1 like

Please or to participate in this conversation.