From cfe5f965503be400f3247af11230f7767710d425 Mon Sep 17 00:00:00 2001 From: Sam Poyigi <6567634+sampoyigi@users.noreply.github.com> Date: Tue, 20 Sep 2022 15:39:02 +0100 Subject: [PATCH] Cache location options Signed-off-by: Sam Poyigi <6567634+sampoyigi@users.noreply.github.com> --- app/admin/traits/HasLocationOptions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/admin/traits/HasLocationOptions.php b/app/admin/traits/HasLocationOptions.php index 57290c7987..84daf29afe 100644 --- a/app/admin/traits/HasLocationOptions.php +++ b/app/admin/traits/HasLocationOptions.php @@ -10,7 +10,7 @@ trait HasLocationOptions public function getOptionsAttribute() { - return $this->all_options->pluck('value', 'item')->toArray(); + return $this->optionsCache ??= $this->all_options->pluck('value', 'item')->toArray(); } public function setOptionsAttribute($value)