mirror of
https://github.com/CachetHQ/Cachet.git
synced 2025-03-14 20:39:44 +01:00
Allow us to set better default settings. Closes #1755
This commit is contained in:
parent
1584883f39
commit
452eb653a5
@ -16,6 +16,13 @@ use CachetHQ\Cachet\Models\Setting as SettingModel;
|
||||
use Exception;
|
||||
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
|
||||
{
|
||||
/**
|
||||
@ -26,7 +33,16 @@ class ConfigServiceProvider extends ServiceProvider
|
||||
public function boot()
|
||||
{
|
||||
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) {
|
||||
//
|
||||
}
|
||||
|
23
config/setting.php
Normal file
23
config/setting.php
Normal 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,
|
||||
];
|
Loading…
x
Reference in New Issue
Block a user