You should use $request->input() instead of $request->get().
But show your full controller code. The answer may lie there.
I am little confused, cause I supposed that request->get() will trim the value which came as query parameter. What is worse is that I am pretty sure that the value does not contain any spaces at the end. The request comes from Postman like query param in form
/dashboard?period=past_7_days
Then I call $request get('period'); and the result is past_7_days with two spaces at the and of the string. Can somebody tell me please what could happened there?
The controller code looks like
public function index(Request $request, DatePeriodMaker $datePeriodMaker): JsonResponse
{
$periodType = trim($request->get('period')); // Its weird but it seems to be necessary
....
}
As I see the trin does not work on this. Its really weird.
Please or to participate in this conversation.