Answer the question
In order to leave comments, you need to log in
How to get all values from middleware?
The task is to check access in a route group. In the route group, I pass 2 values separated by commas.
Route::group(['middleware' => 'roleIds:'.Role::ID__ADMIN,Role::ID__MODERATOR], function () {
роуты
});
dd($roleIds);
Answer the question
In order to leave comments, you need to log in
Collect the string correctly.
Better like this:
'roleIds:' . implode(',', [Role::ID__ADMIN, Role::ID__MODERATOR])
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question