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
Check this section of the documentation related to retreiving input.
From there you could do:
Or, in case you want to limit the search to query parameters: