feat: Try to get settings - error_log on error

This commit is contained in:
IceToast 2022-02-08 09:37:29 +01:00
parent 25d093da94
commit 21485a6175

View file

@ -8,6 +8,7 @@ use Illuminate\Support\Facades\Artisan;
use Illuminate\Support\Facades\Schema;
use Illuminate\Support\Facades\Validator;
use Illuminate\Support\ServiceProvider;
use Exception;
class AppServiceProvider extends ServiceProvider
{
@ -51,7 +52,7 @@ class AppServiceProvider extends ServiceProvider
});
//only run if the installer has been executed
if (file_exists(base_path()."/install.lock")) {
try {
$settings = Settings::all();
// Set all configs from database
foreach ($settings as $setting) {
@ -103,6 +104,8 @@ class AppServiceProvider extends ServiceProvider
// Set Discord-API Config
config(['services.discord.client_id' => config('SETTINGS::DISCORD:CLIENT_ID')]);
config(['services.discord.client_secret' => config('SETTINGS::DISCORD:CLIENT_SECRET')]);
} catch (Exception $e) {
error_log("Settings Error: Could not load settings from database");
}
}
}