add importing options automatically

This commit is contained in:
printempw 2016-09-25 14:32:56 +08:00
parent c86dc05572
commit 2e9ae091da

View File

@ -53,6 +53,10 @@ class OptionRepository implements ArrayAccess, ConfigContract
*/ */
public function get($key, $default = null) 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); return Arr::get($this->items, $key, $default);
} }