-
Notifications
You must be signed in to change notification settings - Fork 71
[Laravel] Can not access request data #136
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I did some tinkering and figured out that this could easily be fixed by changing the way how the laravel request instance is created. Instead of directly creating a new I'd be happy to contribute a PR to fix this. |
Sounds good, pr and test case would be highly appreciated.
Viele Grüße,
Andreas
… Am 05.09.2018 um 18:28 schrieb Tobias Dierich ***@***.***>:
I did some tinkering and figured out that this could easily be fixed by changing the way how the laravel request instance is created.
Instead of directly creating a new Illuminate\Http\Request instance, you could create a Symfony request first and convert it to an Illuminate request by using Illuminate\Http\Request::createFromBase($symfonyRequest). This is the way the laravel kernel does it as well.
I'd be happy to contribute a PR to fix this.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Description
Access the request data using
$request->get('data')
returns nothing, however using$request->data
works.Setup:
Laravel app running inside the
phppm/nginx
containerphp-pm: v1.0.4
php-pm-httpkernel: v1.0.4
Laravel: v5.6
Steps to reproduce:
git clone https://github.com/tobiasdierich/php-pm-example
(The only important bit is here: https://github.com/tobiasdierich/php-pm-example/blob/master/routes/api.php`)composer install --no-dev
docker run -v `pwd`:/var/www -p 8080:80 phppm/nginx --bootstrap=laravel --static-directory=public/
/api/foo
with POST data:/api/bar
Result:
The first request to
/api/foo
returns nothing, the second however returnsbar
.Expected behaviour:
Both requests should return
bar
.The text was updated successfully, but these errors were encountered: