Instead of using the controller in each route, consider using a route controller group. Added to Laravel since v8.80
1// Before 2Route::get('users', [UserController::class, 'index']); 3Route::post('users', [UserController::class, 'store']); 4Route::get('users/{user}', [UserController::class, 'show']); 5Route::get('users/{user}/ban', [UserController::class, 'ban']); 6// After 7Route::controller(UsersController::class)->group(function () { 8 Route::get('users', 'index'); 9 Route::post('users', 'store');10 Route::get('users/{user}', 'show');11 Route::get('users/{user}/ban', 'ban');12});
Tip given by @justsanjit