Skip to content

Commit

Permalink
feat: get setting
Browse files Browse the repository at this point in the history
  • Loading branch information
MatteoPistorello committed Nov 29, 2024
1 parent a1bc26c commit c6b9268
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit c6b9268

Please sign in to comment.