Fix for settings not existing

This commit is contained in:
cp6 2024-05-14 21:52:13 +10:00
parent cd41dcdfff
commit 1aab332ef8

View file

@ -18,6 +18,10 @@ class Settings extends Model
public static function getSettings(): Settings public static function getSettings(): Settings
{ {
return Cache::remember('settings', now()->addWeek(1), function () { return Cache::remember('settings', now()->addWeek(1), function () {
$settings = self::where('id', 1)->first();
if (is_null($settings)){
$settings = Settings::create();
}
return self::where('id', 1)->first(); return self::where('id', 1)->first();
}); });
} }