Allow us to set better default settings. Closes #1755
This commit is contained in:
@@ -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) {
|
||||||
//
|
//
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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,
|
||||||
|
];
|
||||||
Reference in New Issue
Block a user