git commit "add dynamic settings management"
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
use App\Models\Setting;
|
||||
|
||||
if (!function_exists('getUserFullName')) {
|
||||
function getUserFullName(?\App\Models\User $user = null): string
|
||||
{
|
||||
@@ -22,4 +24,22 @@ if (!function_exists('getImageUrl')) {
|
||||
}
|
||||
|
||||
}
|
||||
if (!function_exists('settings')) {
|
||||
function settings(?string $code): ?string
|
||||
{
|
||||
if (!$code) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$setting = Setting::query()
|
||||
->where('code', $code)
|
||||
->first();
|
||||
|
||||
if (!$setting) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $setting->value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user