I can access request params using Request::input()
or Request::all()
.
The problem is that my request includes both GET and POST params, but only GET ones are used to calculate signature.
Is there a way to retrieve only a set of GET or a set of POST params from request in Laravel 5.1?
Or going with $_GET and $_POST is my only option here?
Thank you.
You can use Request::query() to get only GET parameters. Keep in mind that there are no guaranties about consistency in the order of parameters you get from GET, so you might need to sort the array before calculating the signature - depending on how you calculate the signature.
If you need something straightforward you can just use the global helper:
$pathData = request()->path(); <br />
$queryData = request()->query(); <br />
$postData = array_diff(request()->all(), request()->query());
https://laravel.com/docs/5.6/requests
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With