I have been checking out the Laravel source code a bit and I found this bit of code:
return $this->getRealMethod() == 'GET' ? $this->query : $this->request;
From:
https://github.com/illuminate/http/blob/master/Request.php#L668
This basically specifies that if the request method for a request is a 'GET' that the input
method returns the query string parameters and otherwise gives you access to the POST variables.
This means that whenever I would make a post request I can not do the following to get a query string parameter named "date" for example:
$request->input('date')
I know it is useful to not merge POST and GET data since you get the possibility of overriding them but what is the exact motivation behind not allowing a user access to the query parameters when you make a POST request?
The way I see it, the input could have been split up into postInput
and getInput
for example to allow access to both without merging them. Of course you lose the ability that a generic input method gives you, but you gain a lot of flexibility.
Any thoughts on this?