From 2e9ae091da1c6e59bc20975b39dc21fc86a86f37 Mon Sep 17 00:00:00 2001 From: printempw Date: Sun, 25 Sep 2016 14:32:56 +0800 Subject: [PATCH] add importing options automatically --- app/Services/OptionRepository.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/Services/OptionRepository.php b/app/Services/OptionRepository.php index bde77f5b..2a48a339 100644 --- a/app/Services/OptionRepository.php +++ b/app/Services/OptionRepository.php @@ -53,6 +53,10 @@ class OptionRepository implements ArrayAccess, ConfigContract */ public function get($key, $default = null) { + if (!$this->has($key) && Arr::has(config('options'), $key)) { + $this->set($key, config("options.$key")); + } + return Arr::get($this->items, $key, $default); }