I want to map both /tasks
and /tasks/create
into a single route.
Currently the following works:
Route::get('/tasks', 'TaskController@getAll');
Route::get('/tasks/{url}', 'TaskController@getAll')
->where('url', '(create)?');
But there is a code duplication that I want to avoid.
The following works but also maps to /
which I want to exclude:
Route::get('{url}', 'TaskController@getAll')
->where('url', '(tasks|tasks/create)?');
Is there a way to only map those two paths without /
?
via Saggy Manatee And Swan Folk