6
0
Fork 0
jiqu-library-server/app/helpers.php

28 lines
600 B
PHP

<?php
use App\Services\SettingService;
if (! function_exists('app_settings')) {
/**
* 获取/设置应用设置项
*
* @param array|string $key
* @param mixed $default
* @return mixed
*
* @return mixed|\App\Services\SettingService
*/
function app_settings($key = null, $default = null)
{
if (is_null($key)) {
return app(SettingService::class);
}
if (is_array($key)) {
return app(SettingService::class)->set($key);
}
return app(SettingService::class)->get($key, $default);
}
}