Answer the question
In order to leave comments, you need to log in
How to check get parameter in route?
Good afternoon. There is the following code in the route:
Route::get('catalog/{mode?}', '[email protected]');
Route::get('catalog/?mode=setting', '[email protected]');
Answer the question
In order to leave comments, you need to log in
So let's start in the first case
Route::get('catalog/{mode?}', '[email protected]');
you still use a variable as a parameter of the router (path), the question mark tells us that it is optional, maybe, or maybe not. Well, yes, in fact, this is part of the get requests. request()
: ***
$mode = request()->mode;
***
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question