add setting helper

This commit is contained in:
Edward Yang 2022-06-24 14:29:09 +08:00
parent 7510aca48f
commit 4ad4dc3080
2 changed files with 14 additions and 1 deletions

View File

@ -4,6 +4,19 @@ use Beike\Models\AdminUser;
use Illuminate\Support\Str;
use Illuminate\Contracts\Auth\Authenticatable;
/**
* 获取后台设置到 settings 表的值
*
* @param $key
* @param null $default
* @return mixed
*/
function setting($key, $default = null)
{
return config("bk.{$key}", $default);
}
/**
* 获取后台链接
*

View File

@ -38,7 +38,7 @@ class ShopServiceProvider extends ServiceProvider
return $setting->value;
})
->toArray();
config(['global' => $settings]);
config(['bk' => $settings]);
}
protected function loadShareView()