From fe43a2ad5bc470109e0e85429c674a2edae57ce5 Mon Sep 17 00:00:00 2001 From: James Brooks Date: Sun, 3 Jan 2016 15:14:22 +0000 Subject: [PATCH] Call first() on the query itself --- app/Presenters/ComponentGroupPresenter.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Presenters/ComponentGroupPresenter.php b/app/Presenters/ComponentGroupPresenter.php index 4899fecc..447f32f0 100644 --- a/app/Presenters/ComponentGroupPresenter.php +++ b/app/Presenters/ComponentGroupPresenter.php @@ -24,7 +24,7 @@ class ComponentGroupPresenter extends AbstractPresenter */ public function lowest_status() { - if ($component = $this->wrappedObject->enabled_components_lowest->first()) { + if ($component = $this->wrappedObject->enabled_components_lowest()->first()) { return $component->status; } } @@ -36,7 +36,7 @@ class ComponentGroupPresenter extends AbstractPresenter */ public function lowest_human_status() { - if ($component = $this->wrappedObject->enabled_components_lowest->first()) { + if ($component = $this->wrappedObject->enabled_components_lowest()->first()) { return $component->human_status; } } @@ -48,7 +48,7 @@ class ComponentGroupPresenter extends AbstractPresenter */ public function lowest_status_color() { - if ($component = $this->wrappedObject->enabled_components_lowest->first()) { + if ($component = $this->wrappedObject->enabled_components_lowest()->first()) { return $component->status_color; } }