-2

I'm trying to listen to simple get param (test param) in laravel middleware.
here is my code

Route::middleware('api')->get('/betshistory', function (Request $request) {

return $request->user();
});

here is my url:
http://localhost:8080/api/betshistory?test=45

i tried doing this:

    print_r($request->parameter('test'));
print_r(Route::current()->parameter('test'));
print_r($request->route()->paremeters('test'));

but i cannot catch it. what am i missing? Thanks

sortof
  • 530
  • 1
  • 8
  • 18

2 Answers2

1

Check this section of the documentation related to retreiving input.

From there you could do:

$test = $request->parameter('test');

Or, in case you want to limit the search to query parameters:

$test = $request->query('test');
Kenny Horna
  • 13,485
  • 4
  • 44
  • 71
-1

that was the answer

$request->input('name');

Thanks

sortof
  • 530
  • 1
  • 8
  • 18