1use App\Http\Controllers\UserController;
2use App\Models\User;
3
4// Route definition...
5Route::get('/users/{user}', [UserController::class, 'show']);
6
7// Controller method definition...
8public function show(User $user)
9{
10 return view('user.profile', ['user' => $user]);
11}
1Route::get('user/{id}/profile', function ($id) {
2 //
3})->name('profile');
4
5$url = route('profile', ['id' => 1, 'photos' => 'yes']);
6
7// /user/1/profile?photos=yes