我有所有这些路线:
Route::resource('tournaments', 'TournamentController');
Route::get('/tournaments/deleted', 'TournamentController@getDeleted');
当我访问
时/tournaments/deleted
我得到了
Model Not Found
in
SubstituteBindings Middleware
认为删除的是我的锦标赛slu ..
我该如何解决这个问题?
答案 0 :(得分:0)
解决方案是首先定义getDeleted Route,然后定义ressource:
工作:
Route::get('/tournaments/deleted', 'TournamentController@getDeleted')->name('getDeleted'); // Already has auth middleware
Route::resource('tournaments', 'TournamentController');
不工作:
Route::resource('tournaments', 'TournamentController');
Route::get('/tournaments/deleted', 'TournamentController@getDeleted')->name('getDeleted'); // Already has auth middleware