From 2970b3bc20c5682327a6acc5ce7afe31ecfe56f9 Mon Sep 17 00:00:00 2001 From: CaReS0107 <32643188+CaReS0107@users.noreply.github.com> Date: Thu, 7 Oct 2021 09:41:06 +0300 Subject: [PATCH] Get repository from this (#422) * Get repository from this * Fix styling Co-authored-by: Vasile Papuc Co-authored-by: CaReS0107 --- src/Repositories/Repository.php | 4 ++-- tests/Controllers/RepositoryPatchControllerTest.php | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Repositories/Repository.php b/src/Repositories/Repository.php index 0d15f648..37431f3b 100644 --- a/src/Repositories/Repository.php +++ b/src/Repositories/Repository.php @@ -636,7 +636,7 @@ public function store(RestifyRequest $request) $fields->each(fn (Field $field) => $field->invokeAfter($request, $this->resource)); - $request->repository() + $this ->collectFields($request) ->forStore($request, $this) ->withActions($request, $this) @@ -709,7 +709,7 @@ public function update(RestifyRequest $request, $repositoryId) fn (Field $field) => $field->invokeAfter($request, $this->resource) ); - $request->repository() + $this ->collectFields($request) ->forUpdate($request, $this) ->withActions($request, $this) diff --git a/tests/Controllers/RepositoryPatchControllerTest.php b/tests/Controllers/RepositoryPatchControllerTest.php index 70111346..703ef9d0 100644 --- a/tests/Controllers/RepositoryPatchControllerTest.php +++ b/tests/Controllers/RepositoryPatchControllerTest.php @@ -2,7 +2,6 @@ namespace Binaryk\LaravelRestify\Tests\Controllers; -use Binaryk\LaravelRestify\Fields\Field; use Binaryk\LaravelRestify\Tests\Fixtures\Post\Post; use Binaryk\LaravelRestify\Tests\Fixtures\Post\PostRepository; use Binaryk\LaravelRestify\Tests\IntegrationTest;