Fix call to getIncludesForTransformer
This commit is contained in:
parent
9e0ec8fca8
commit
1bc1b87422
|
@ -34,11 +34,10 @@ class ClientController extends ClientApiController
|
||||||
public function index(GetServersRequest $request): array
|
public function index(GetServersRequest $request): array
|
||||||
{
|
{
|
||||||
$user = $request->user();
|
$user = $request->user();
|
||||||
$transformer = ServerTransformer::class;
|
|
||||||
|
|
||||||
// Start the query builder and ensure we eager load any requested relationships from the request.
|
// Start the query builder and ensure we eager load any requested relationships from the request.
|
||||||
$builder = QueryBuilder::for(
|
$builder = QueryBuilder::for(
|
||||||
Server::query()->with($this->getIncludesForTransformer($transformer, ['node']))
|
Server::query()->with($this->getIncludesForTransformer(new ServerTransformer(), ['node']))
|
||||||
)->allowedFilters([
|
)->allowedFilters([
|
||||||
'uuid',
|
'uuid',
|
||||||
'name',
|
'name',
|
||||||
|
@ -69,7 +68,7 @@ class ClientController extends ClientApiController
|
||||||
|
|
||||||
$servers = $builder->paginate(min($request->query('per_page', 50), 100))->appends($request->query());
|
$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();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue