diff --git a/app/Http/Controllers/OrganisationController.php b/app/Http/Controllers/OrganisationController.php index 4e41198..85eef73 100644 --- a/app/Http/Controllers/OrganisationController.php +++ b/app/Http/Controllers/OrganisationController.php @@ -68,7 +68,7 @@ public function getAll(Request $request) { try { /** @var Collection $orgs */ - $orgs = $this->orgRepo->all(); + $orgs = $this->orgRepo->all()->load('details'); } catch (\Exception $e) { Log::error('Could not get Organisations list', ['message' => $e->getMessage()]); @@ -79,10 +79,6 @@ public function getAll(Request $request) ], 500); } - $orgs->each(function (Organisation $org) { - $org->load('details'); - }); - $resource = new \League\Fractal\Resource\Collection($orgs, new OrganisationTransformer([ 'unpublished' => $request->header('x-api-key') ? false : true, ]));