0

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?

  • `$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
  • 1
    Does 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 Answers1

-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