git commit "add dynamic settings management"

This commit is contained in:
2026-08-20 13:12:51 +03:30
parent c04879b0d6
commit 598be63d71
17 changed files with 972 additions and 642 deletions
+20
View File
@@ -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;
}
}