I know that one can use $request->get('my_param')
or Input::get('my_param')
to get a POST or GET request parameter in Laravel (I'm toying with v5/dev version now, but it's the same for 4.2).
But how can I make sure that my my_param
came via a POST parameter and was not just from a ?my_param=42
appended to the URL? (besides reverting to the ol' $_POST
and $_GET
superglobals and throwing testability out the window)
(注意:我还知道,如果POST和URL/GET参数都具有相同的名称,Request::get
方法将为我提供POST请求的POST参数,但是.但是如果参数是通过url查询字符串进入的,我想用一种Laravel惯用的方式来了解这一点.)