diff --git a/composer.json b/composer.json index 0c512ff..dea5e00 100644 --- a/composer.json +++ b/composer.json @@ -22,5 +22,5 @@ ], "minimum-stability": "dev", "require": {}, - "version": "0.1.4" + "version": "0.1.5" } diff --git a/src/SystemSettingsDBServiceProvider.php b/src/SystemSettingsDBServiceProvider.php index 3250edd..1904900 100644 --- a/src/SystemSettingsDBServiceProvider.php +++ b/src/SystemSettingsDBServiceProvider.php @@ -15,17 +15,22 @@ public function register(): void public function boot(): void { - if (Schema::hasTable('system_settings')) { - config([ - 'system-settings' => Cache::remember('system-settings', config('system-settings-db.cache-ttl') ?? 60, function () { - return SystemSetting::all(['key','value']) - ->keyBy('key') - ->transform(function ($setting) { - return $setting->value; - }) - ->toArray(); - }) - ]); + try { + if (Schema::hasTable('system_settings')) { + config([ + 'system-settings' => Cache::remember('system-settings', config('system-settings-db.cache-ttl') ?? 60, function () { + return SystemSetting::all(['key','value']) + ->keyBy('key') + ->transform(function ($setting) { + return $setting->value; + }) + ->toArray(); + }) + ]); + } + } + catch (\Exception $e) { + // Do nothing }