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