If you want to create a controller with just one action, you can use __invoke()
method and even create "invokable" controller.
Route:
1Route::get('user/{id}', 'ShowProfile');
Artisan:
1php artisan make:controller ShowProfile --invokable
Controller:
1class ShowProfile extends Controller2{3 public function __invoke($id)4 {5 return view('user.profile', [6 'user' => User::findOrFail($id)7 ]);8 }9}