Answer the question
In order to leave comments, you need to log in
Is it possible to add an arbitrary parameter to routes?
Hello!
For example, there is a route or resource:
Route::get('users/settings/reset', '[email protected]')->name('users.settings.reset');
Route::resource('users', 'UserController');
Route::get('users/settings/reset', '[email protected]')->name('users.settings.reset')->custom('Комментарий к роуту');
Route::resource('users', 'UserController')->custom([
'index' => 'Комментарий к index роуту',
'create' => 'Комментарий к create роуту',
]);
Answer the question
In order to leave comments, you need to log in
What you want is done using annotations or a similar mechanism.
Only in this case you don't need anything like that. It is necessary to delimit the rights not by receptions, but by actions. To do this, there are policies and libraries that manage them, such as bouncer. Read and google.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question