Deal with cases when we have no settings properly

This commit is contained in:
Graham Campbell
2016-05-24 17:12:08 +01:00
parent 20e4ae5ff8
commit 4549c51959
@@ -40,9 +40,11 @@ class ConfigServiceProvider extends ServiceProvider
$cache = false;
}
$this->app->terminating(function () use ($path) {
$this->app->terminating(function () use ($cache, $path) {
if ($this->app->setting->stale()) {
$this->app->files->put($path, '<?php return '.var_export($this->app->setting->all(), true).';'.PHP_EOL);
} elseif ($cache === false) {
$this->app->files->put($path, '<?php return '.var_export([], true).';'.PHP_EOL);
}
});