From 1bc1b87422c68c0bd0ebd642afe6c5736c42a165 Mon Sep 17 00:00:00 2001 From: Dane Everitt Date: Sat, 7 Aug 2021 14:54:22 -0700 Subject: [PATCH] Fix call to getIncludesForTransformer --- app/Http/Controllers/Api/Client/ClientController.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app/Http/Controllers/Api/Client/ClientController.php b/app/Http/Controllers/Api/Client/ClientController.php index 53e84603c..67b15555d 100644 --- a/app/Http/Controllers/Api/Client/ClientController.php +++ b/app/Http/Controllers/Api/Client/ClientController.php @@ -34,11 +34,10 @@ class ClientController extends ClientApiController public function index(GetServersRequest $request): array { $user = $request->user(); - $transformer = ServerTransformer::class; // Start the query builder and ensure we eager load any requested relationships from the request. $builder = QueryBuilder::for( - Server::query()->with($this->getIncludesForTransformer($transformer, ['node'])) + Server::query()->with($this->getIncludesForTransformer(new ServerTransformer(), ['node'])) )->allowedFilters([ 'uuid', 'name', @@ -69,7 +68,7 @@ class ClientController extends ClientApiController $servers = $builder->paginate(min($request->query('per_page', 50), 100))->appends($request->query()); - return $this->fractal->transformWith($transformer)->collection($servers)->toArray(); + return $this->fractal->transformWith(new ServerTransformer())->collection($servers)->toArray(); } /**