How do I get the key-value pair from a route like this https://www .domain.com/path?param=x
without using this {param?}
the get route?
Asked
Active
Viewed 277 times
0

Alex UnLimited
- 99
- 1
- 9
-
`$val = $request->param ?? null;` or `$val = $request->input('param') ?? null;` – STA Aug 21 '20 at 19:40
-
yea but what if I have a function that doesn't get the $request param? – Alex UnLimited Aug 21 '20 at 19:51
-
1Does this answer your question? [Access query string values from Laravel](https://stackoverflow.com/questions/24744825/access-query-string-values-from-laravel) – miken32 Aug 21 '20 at 20:14
1 Answers
-1
You can use php global variables $_REQUEST to get the requested parameter. In above case you can use $_REQUEST['param']
$param=$_REQUEST['param'];

Hamza Dairywala
- 482
- 2
- 11