1
0
mirror of https://github.com/devcode-it/openstamanager.git synced 2025-02-10 08:30:48 +01:00

feat: get setting

This commit is contained in:
MatteoPistorello 2024-11-29 14:53:24 +01:00
parent a1bc26c46c
commit c6b9268f02

View File

@ -110,11 +110,12 @@ function setting($name, $again = false)
$user = Auth::user();
if ($user) {
$user_options = json_decode($user->options, true) ?: [];
$user_options = json_decode($user->options ?: '', true) ?: [];
}
if ($user_options['settings'][$setting->id] !== null) {
$value = $user_options['settings'][$setting->id];
$value = is_array($value) ? implode(',', $value) : $value;
} else {
$value = $setting->valore;
}