Instead of using the controller in each route, consider using a route controller group. Added to Laravel since v8.80
// BeforeRoute::get('users', [UserController::class, 'index']);Route::post('users', [UserController::class, 'store']);Route::get('users/{user}', [UserController::class, 'show']);Route::get('users/{user}/ban', [UserController::class, 'ban']);// AfterRoute::controller(UsersController::class)->group(function () { Route::get('users', 'index'); Route::post('users', 'store'); Route::get('users/{user}', 'show'); Route::get('users/{user}/ban', 'ban');});
Tip given by @justsanjit