Bad Practice Example
Route::resource('recipes', 'RecipeController'); Route::get('recipes/restore/one/{recipe}', [\App\Http\Controllers\RecipeController::class, 'restore' ); Route::get('recipes/restore_all', [\App\Http\Controllers\RecipeController::class, 'restoreAll' );
What To Do Instead
Route::get('recipes/restore/one/{recipe}', [\App\Http\Controllers\RecipeController::class, 'restore' ); Route::get('recipes/restore_all', [\App\Http\Controllers\RecipeController::class, 'restoreAll' );
Route::resource('recipes', 'RecipeController');
اذا كنت تستخدم route::resource ويوجد route أخرى تؤدي إلى نفس الـ controller، فإنه يجب وضعها قبل route::resource.