Skip to content

Commit

Permalink
Cache location options
Browse files Browse the repository at this point in the history
Signed-off-by: Sam Poyigi <6567634+sampoyigi@users.noreply.github.com>
  • Loading branch information
sampoyigi committed Sep 20, 2022
1 parent 5bf7b4e commit cfe5f96
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/admin/traits/HasLocationOptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit cfe5f96

Please sign in to comment.