Catch QueryException incase we're not setup. Closes #383
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
namespace CachetHQ\Cachet\Providers;
|
||||
|
||||
use CachetHQ\Cachet\Models\Setting;
|
||||
use Illuminate\Database\QueryException;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
|
||||
class LoadConfigServiceProvider extends ServiceProvider
|
||||
@@ -14,10 +15,16 @@ class LoadConfigServiceProvider extends ServiceProvider
|
||||
*/
|
||||
public function boot()
|
||||
{
|
||||
// Get app custom configuration.
|
||||
$appDomain = Setting::get('app_domain');
|
||||
$appTimezone = Setting::get('app_timezone');
|
||||
$appLocale = Setting::get('app_locale');
|
||||
$appDomain = $appTimezone = $appLocale = null;
|
||||
|
||||
try {
|
||||
// Get app custom configuration.
|
||||
$appDomain = Setting::get('app_domain');
|
||||
$appTimezone = Setting::get('app_timezone');
|
||||
$appLocale = Setting::get('app_locale');
|
||||
} catch (QueryException $e) {
|
||||
// Don't throw any errors, we may not be setup yet.
|
||||
}
|
||||
|
||||
// Override default app values.
|
||||
$this->app->config->set('app.url', $appDomain ?: $this->app->config->get('app.url'));
|
||||
|
||||
Reference in New Issue
Block a user