|
@@ -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]);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|