Laravel 5.x将特定路径路由到单一路径

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 /?

If you only want the routes tasks/ and tasks/create you could just do:

Route::get('/tasks', 'TaskController@getAll');
Route::get('/tasks/create', 'TaskController@getAll');

Hope this helps!