From 5bcfea73cc985a7ffe985b7bba1423ce53ea76d0 Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Tue, 4 Aug 2015 21:22:34 +0930 Subject: [PATCH] Add the parsedBody to API request input --- framework/core/src/Api/ApiServiceProvider.php | 8 +++++++- framework/core/src/Events/RegisterApiRoutes.php | 8 +++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/framework/core/src/Api/ApiServiceProvider.php b/framework/core/src/Api/ApiServiceProvider.php index 4002bdd89..de8f2886b 100644 --- a/framework/core/src/Api/ApiServiceProvider.php +++ b/framework/core/src/Api/ApiServiceProvider.php @@ -349,7 +349,13 @@ class ApiServiceProvider extends ServiceProvider $action = app($class); $actor = app('flarum.actor'); - $input = array_merge($httpRequest->getQueryParams(), $httpRequest->getAttributes(), $routeParams); + $input = array_merge( + $httpRequest->getQueryParams(), + $httpRequest->getAttributes(), + $httpRequest->getParsedBody(), + $routeParams + ); + $request = new Request($input, $actor, $httpRequest); return $action->handle($request); diff --git a/framework/core/src/Events/RegisterApiRoutes.php b/framework/core/src/Events/RegisterApiRoutes.php index 206ce43c4..e5ecb4cb5 100644 --- a/framework/core/src/Events/RegisterApiRoutes.php +++ b/framework/core/src/Events/RegisterApiRoutes.php @@ -50,7 +50,13 @@ class RegisterApiRoutes $action = app($class); $actor = app('flarum.actor'); - $input = array_merge($httpRequest->getQueryParams(), $httpRequest->getAttributes(), $routeParams); + $input = array_merge( + $httpRequest->getQueryParams(), + $httpRequest->getAttributes(), + $httpRequest->getParsedBody(), + $routeParams + ); + $request = new Request($input, $actor, $httpRequest); return $action->handle($request);