From d562ccfdcdf608a9b0f60ceb16bcf7796e721b04 Mon Sep 17 00:00:00 2001 From: ilestis Date: Fri, 8 Dec 2023 15:55:10 -0600 Subject: [PATCH] Fix lazy load on connections --- app/Http/Controllers/Entity/RelationController.php | 1 + app/Services/Entity/ConnectionService.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/Http/Controllers/Entity/RelationController.php b/app/Http/Controllers/Entity/RelationController.php index 845cb67d9c..2ee4c97103 100644 --- a/app/Http/Controllers/Entity/RelationController.php +++ b/app/Http/Controllers/Entity/RelationController.php @@ -53,6 +53,7 @@ public function index(Campaign $campaign, Entity $entity) $rows = $entity ->allRelationships() ->sort(request()->only(['o', 'k'])) + ->with(['owner', 'target', 'target.location', 'target.location.entity']) ->paginate() ->withPath(route('entities.relations_table', ['campaign' => $campaign, 'entity' => $entity, 'mode' => 'table'])); diff --git a/app/Services/Entity/ConnectionService.php b/app/Services/Entity/ConnectionService.php index fe82c3046e..be389573d5 100644 --- a/app/Services/Entity/ConnectionService.php +++ b/app/Services/Entity/ConnectionService.php @@ -57,8 +57,8 @@ public function connections() // Prepare ids for pagination $this->prepareIds(); - return Entity::whereIn('id', $this->ids) + ->with('image') ->orderBy($this->order) ->paginate(); }