I am sending Query Params in Postman to a GET route.
The first parameter is sortByLocation which is a boolean value:
Of course I want to get it as boolean at backend.
I have a Form Request class named GetActivitiesRequest and one rule is:
'sortByLocation' => 'nullable|boolean',
When I send the request on Postman, I get the error:
{
"message": "The sort by location field must be true or false.",
"errors": {
"sortByLocation": [
"The sort by location field must be true or false."
]
}
}
So, the question is obvious, how can I get query params in their original types?