From 9da0476434c82c750dfb3d6afda8f4efd580c70e Mon Sep 17 00:00:00 2001 From: Ahmed Fathy Date: Tue, 21 Apr 2020 15:57:03 +0200 Subject: [PATCH 1/2] Update JsonResource namespace --- src/Commands/stubs/resource.stub | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Commands/stubs/resource.stub b/src/Commands/stubs/resource.stub index c67afeea9..6a1f18390 100644 --- a/src/Commands/stubs/resource.stub +++ b/src/Commands/stubs/resource.stub @@ -2,9 +2,9 @@ namespace $NAMESPACE$; -use Illuminate\Http\Resources\Json\Resource; +use Illuminate\Http\Resources\Json\JsonResource; -class $CLASS$ extends Resource +class $CLASS$ extends JsonResource { /** * Transform the resource into an array. From e79fc181054c8718ea9965ea4ad1c71ca3de2abd Mon Sep 17 00:00:00 2001 From: Ahmed Fathy Date: Tue, 21 Apr 2020 22:33:28 +0200 Subject: [PATCH 2/2] update test --- ...CommandTest__it_generated_correct_file_with_content__1.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/Commands/__snapshots__/ResourceMakeCommandTest__it_generated_correct_file_with_content__1.php b/tests/Commands/__snapshots__/ResourceMakeCommandTest__it_generated_correct_file_with_content__1.php index 6abb070b9..e2b3765ef 100644 --- a/tests/Commands/__snapshots__/ResourceMakeCommandTest__it_generated_correct_file_with_content__1.php +++ b/tests/Commands/__snapshots__/ResourceMakeCommandTest__it_generated_correct_file_with_content__1.php @@ -2,9 +2,9 @@ namespace Modules\\Blog\\Transformers; -use Illuminate\\Http\\Resources\\Json\\Resource; +use Illuminate\\Http\\Resources\\Json\\JsonResource; -class PostsTransformer extends Resource +class PostsTransformer extends JsonResource { /** * Transform the resource into an array.