我有这个路线分组:
Route::prefix('categories')->group(function () {
Route::get('/{url?}', 'CategoriesController@index')->where('', 'all');
Route::get('/create', 'CategoriesController@create');
Route::get('/{slug}', 'CategoriesController@show');
Route::get('/edit/{categories}', 'CategoriesController@edit');
Route::post('/store', 'CategoriesController@store');
Route::post('/update/{id}', 'CategoriesController@update');
Route::delete('/destroy/{id}', 'CategoriesController@destroy');
});
类别/ |类别/所有|类别|子段的所有路线都将到达CategoriesController@index
是否有一种方法可以使当前逻辑正常工作-如果网址为空或全部转到索引,其他所有内容都将转到 show 方法?