You've already forked Epicnabbo-Catalogus-Updated-Daily
🆙 More fixes 🆙
This commit is contained in:
@@ -10,15 +10,17 @@ use Throwable;
|
||||
|
||||
class SettingsService
|
||||
{
|
||||
public ?Collection $settings;
|
||||
public private(set) ?Collection $settings;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
try {
|
||||
$this->settings = Cache::remember(
|
||||
'website_settings',
|
||||
now()->addMinutes(5),
|
||||
fn () => Schema::hasTable('website_settings') ? WebsiteSetting::all()->pluck('value', 'key') : collect()
|
||||
key: 'website_settings',
|
||||
ttl: now()->addMinutes(5),
|
||||
callback: fn () => Schema::hasTable('website_settings')
|
||||
? WebsiteSetting::all()->pluck('value', 'key')
|
||||
: collect()
|
||||
);
|
||||
} catch (Throwable) {
|
||||
$this->settings = collect();
|
||||
@@ -40,9 +42,11 @@ class SettingsService
|
||||
|
||||
try {
|
||||
$this->settings = Cache::remember(
|
||||
'website_settings',
|
||||
now()->addMinutes(5),
|
||||
fn () => Schema::hasTable('website_settings') ? WebsiteSetting::all()->pluck('value', 'key') : collect()
|
||||
key: 'website_settings',
|
||||
ttl: now()->addMinutes(5),
|
||||
callback: fn () => Schema::hasTable('website_settings')
|
||||
? WebsiteSetting::all()->pluck('value', 'key')
|
||||
: collect()
|
||||
);
|
||||
} catch (Throwable) {
|
||||
$this->settings = collect();
|
||||
|
||||
Reference in New Issue
Block a user