From 177c14d03a548042976029dc5ed689acc3dfb9fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nil=20Portugu=C3=A9s=20Calder=C3=B3?= Date: Mon, 27 Jun 2016 21:36:47 +0200 Subject: [PATCH] Fix for URL generation. Does not ignore URL parts --- .../Laravel5/JsonApi/Controller/JsonApiController.php | 3 +-- src/NilPortugues/Laravel5/JsonApi/Controller/JsonApiTrait.php | 4 ---- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/src/NilPortugues/Laravel5/JsonApi/Controller/JsonApiController.php b/src/NilPortugues/Laravel5/JsonApi/Controller/JsonApiController.php index 2d97d64..ffedcdc 100644 --- a/src/NilPortugues/Laravel5/JsonApi/Controller/JsonApiController.php +++ b/src/NilPortugues/Laravel5/JsonApi/Controller/JsonApiController.php @@ -11,8 +11,6 @@ namespace NilPortugues\Laravel5\JsonApi\Controller; use Illuminate\Routing\Controller; -use Illuminate\Container\Container; -use Illuminate\Database\Eloquent\Model; use Illuminate\Http\Request; use NilPortugues\Api\JsonApi\Http\Factory\RequestFactory; use NilPortugues\Api\JsonApi\Http\Response\ResourceNotFound; @@ -100,6 +98,7 @@ public function store(Request $request) { $createResource = $this->createResourceCallable(); $resource = new CreateResource($this->serializer); + return $this->addHeaders( $resource->get((array) $request->get('data'), get_class($this->getDataModel()), $createResource) ); diff --git a/src/NilPortugues/Laravel5/JsonApi/Controller/JsonApiTrait.php b/src/NilPortugues/Laravel5/JsonApi/Controller/JsonApiTrait.php index 11eb484..55bee83 100644 --- a/src/NilPortugues/Laravel5/JsonApi/Controller/JsonApiTrait.php +++ b/src/NilPortugues/Laravel5/JsonApi/Controller/JsonApiTrait.php @@ -13,10 +13,6 @@ use Illuminate\Container\Container; use Illuminate\Database\Eloquent\Model; use Illuminate\Http\Request; -use NilPortugues\Laravel5\JsonApi\Actions\CreateResource; -use NilPortugues\Laravel5\JsonApi\Actions\DeleteResource; -use NilPortugues\Laravel5\JsonApi\Actions\GetResource; -use NilPortugues\Laravel5\JsonApi\Actions\ListResource; use NilPortugues\Laravel5\JsonApi\Actions\PatchResource; use NilPortugues\Laravel5\JsonApi\Actions\PutResource; use NilPortugues\Api\JsonApi\Server\Errors\Error;