I have created similar, but two different Request files for an api controller and web controller.
I used same middleware for both to change the request parameter.
$request['size'] = min(20000, 1); return $next($request);
When I dump, in API request and Web request like following,
the output for API is “20000” and Web is “1”. Also, please note that
dd($this->request->all()); Outputs : [ 'size' => "1" ]
for both. I want to know how $this->size shows different value in both requests.
it will give you the size of $size variable in class not the value of $request , check whether you have defined size variable in class.