I've been trying to find some documentation on how to accomplish the following, but it seems like maybe I'm not using the correct search terms.
I would like to implement some simplified routes in Laravel 5.4 by omitting the route name from the path – for example:
/{page}
instead of/pages/{page}
/profile
instead of/users/{user}/edit
/{exam}/{question}
(or even/exams/{exam}/{question}
) instead of/exams/{exam}/questions/{question}
Example of current routes
Route::resource('exams.questions', 'ExamQuestionController', ['only' => ['show']]);
// exams/{exam}/question/{question}
I know how to do this with route closures and one-off routes (e.g.: Route::get...
) but is there a way to do this using Route::resource
?
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire