I'm editing my application routing files to make them as neat as possible. So I've done this in my "web.php":
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
|
Although this works fine, I find this line to be redundant:
Route::resource('alquileres',AlquilerController::class)->parameters(['alquileres' => 'alquiler']);
, because I repeat the text "AlquilerController::class", Both are in the parameter 'Route::controller' and then the second parameter of 'Route::resource'.
Is there any way to avoid this? I tried doing some "error_log" at the beginning of the "group" callback body just to see what I got, but I can't find a solution.
Thank you so much!
P粉0225014952024-04-05 00:55:16
How to declare a variable with the value of the controller class before the routing group and then use the variable in the routing group class to avoid duplication
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
|