Skip to content

[Laravel] Can not access request data #136

Description

@tobiasdierich

Description

Access the request data using $request->get('data') returns nothing, however using $request->data works.

Setup:

Laravel app running inside the phppm/nginx container

php-pm: v1.0.4
php-pm-httpkernel: v1.0.4
Laravel: v5.6

Steps to reproduce:

  1. Clone my example repo: 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`)
  2. Run composer: composer install --no-dev
  3. Start php-pm: docker run -v `pwd`:/var/www -p 8080:80 phppm/nginx --bootstrap=laravel --static-directory=public/
  4. Make a post request to /api/foo with POST data:
{
   "foo": "bar"
}
  1. Make the same request to /api/bar

Result:

The first request to /api/foo returns nothing, the second however returns bar.

Expected behaviour:

Both requests should return bar.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions