Merge pull request #1768 from CachetHQ/default-settings

Allow us to set better default settings
This commit is contained in:
James Brooks
2016-05-08 16:24:57 +01:00
2 changed files with 40 additions and 1 deletions
@@ -16,6 +16,13 @@ use CachetHQ\Cachet\Models\Setting as SettingModel;
use Exception; use Exception;
use Illuminate\Support\ServiceProvider; use Illuminate\Support\ServiceProvider;
/**
* This is the config service provider class.
*
* @author James Brooks <james@alt-three.com>
* @author Graham Campbell <graham@alt-three.com>
* @author Joe Cohen <joe@alt-three.com>
*/
class ConfigServiceProvider extends ServiceProvider class ConfigServiceProvider extends ServiceProvider
{ {
/** /**
@@ -26,7 +33,16 @@ class ConfigServiceProvider extends ServiceProvider
public function boot() public function boot()
{ {
try { try {
$this->app->config->set('setting', $this->app->setting->all()); // Get the default settings.
$defaultSettings = $this->app->config->get('setting');
// Get the configured settings.
$appSettings = $this->app->setting->all();
// Merge the settings
$settings = array_merge($defaultSettings, $appSettings);
$this->app->config->set('setting', $settings);
} catch (Exception $e) { } catch (Exception $e) {
// //
} }
+23
View File
@@ -0,0 +1,23 @@
<?php
/*
* This file is part of Cachet.
*
* (c) Alt Three Services Limited
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
return [
/*
|--------------------------------------------------------------------------
| Dashboard Login Link
|--------------------------------------------------------------------------
|
| Whether to show the dashboard link in the footer by default.
|
*/
'dashboard_login_link' => true,
];