fix: 🚑️ eloquent query crashes composer install if no DB-Data is set.
This commit is contained in:
parent
9b11e16ed6
commit
046a34c1ee
1 changed files with 13 additions and 10 deletions
|
@ -4,6 +4,7 @@ namespace App\Providers;
|
|||
|
||||
use App\Models\Settings;
|
||||
use Illuminate\Pagination\Paginator;
|
||||
use Illuminate\Support\Facades\App;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Support\Facades\Validator;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
|
@ -50,18 +51,20 @@ class AppServiceProvider extends ServiceProvider
|
|||
return $ok;
|
||||
});
|
||||
|
||||
// Set Discord-API Config
|
||||
config(['services.discord.client_id' => Settings::getValueByKey('SETTINGS::DISCORD:CLIENT_ID')]);
|
||||
config(['services.discord.client_secret' => Settings::getValueByKey('SETTINGS::DISCORD:CLIENT_SECRET')]);
|
||||
if (!App::runningInConsole()) {
|
||||
// Set Discord-API Config
|
||||
config(['services.discord.client_id' => Settings::getValueByKey('SETTINGS::DISCORD:CLIENT_ID')]);
|
||||
config(['services.discord.client_secret' => Settings::getValueByKey('SETTINGS::DISCORD:CLIENT_SECRET')]);
|
||||
|
||||
// Set Recaptcha API Config
|
||||
config(['recaptcha.api_site_key' => Settings::getValueByKey('SETTINGS::RECAPTCHA:SITE_KEY')]);
|
||||
config(['recaptcha.api_secret_key' => Settings::getValueByKey('SETTINGS::RECAPTCHA:SECRET_KEY')]);
|
||||
// Set Recaptcha API Config
|
||||
config(['recaptcha.api_site_key' => Settings::getValueByKey('SETTINGS::RECAPTCHA:SITE_KEY')]);
|
||||
config(['recaptcha.api_secret_key' => Settings::getValueByKey('SETTINGS::RECAPTCHA:SECRET_KEY')]);
|
||||
|
||||
// Set all configs from database
|
||||
$settings = Settings::all();
|
||||
foreach ($settings as $setting) {
|
||||
config([$setting->key => $setting->value]);
|
||||
// Set all configs from database
|
||||
$settings = Settings::all();
|
||||
foreach ($settings as $setting) {
|
||||
config([$setting->key => $setting->value]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue