I have the following route:
Route::get('/user/{user:name}', [ProfileController::class, 'orders'])->name('profile.orders');
and the following method:
public function orders(User $user): View
{
return view...
}
The code works unless the name has a #
in the name, for example username#1234
, the hashtag and everything after it is ignored and the user is obviously not found and I see the 404 Not Found
page. Is there a way to solve this since I tried accepting a string and then search for a username but the same problem persists.