mirror of
https://github.com/lkddi/Xboard.git
synced 2026-04-03 10:30:51 +08:00
Initial commit
This commit is contained in:
33
app/Helpers/Functions.php
Normal file
33
app/Helpers/Functions.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
|
||||
if (! function_exists("get_request_content")){
|
||||
function get_request_content(){
|
||||
|
||||
return request()->getContent() ?: json_encode($_POST);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if (! function_exists('admin_setting')) {
|
||||
/**
|
||||
* 获取或保存配置参数.
|
||||
*
|
||||
* @param string|array $key
|
||||
* @param mixed $default
|
||||
* @return App\Support\Setting|mixed
|
||||
*/
|
||||
function admin_setting($key = null, $default = null)
|
||||
{
|
||||
if ($key === null) {
|
||||
return app('setting');
|
||||
}
|
||||
|
||||
if (is_array($key)) {
|
||||
app('setting')->save($key);
|
||||
return;
|
||||
}
|
||||
$default = config('v2board.'. $key) ?? $default;
|
||||
return app('setting')->get($key, $default) ;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user