mirror of
https://github.com/CachetHQ/Cachet.git
synced 2025-01-29 11:08:53 +01:00
Get default value on config repository
This commit is contained in:
parent
33f6bf167c
commit
10bcbc6169
@ -25,8 +25,8 @@ class ThemeComposer
|
||||
*/
|
||||
public function compose(View $view)
|
||||
{
|
||||
$view->with('themeBackgroundColor', Setting::get('style_background_color') ?: null);
|
||||
$view->with('themeTextColor', Setting::get('style_text_color') ?: null);
|
||||
$view->with('themeBackgroundColor', Setting::get('style_background_color'));
|
||||
$view->with('themeTextColor', Setting::get('style_text_color'));
|
||||
|
||||
$viewData = $view->getData();
|
||||
$themeView = array_only($viewData, preg_grep('/^theme/', array_keys($viewData)));
|
||||
|
@ -45,11 +45,12 @@ class Repository
|
||||
* Returns a setting from the database.
|
||||
*
|
||||
* @param string $name
|
||||
* @param string $default
|
||||
* @param bool $checkEnv
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function get($name, $checkEnv = true)
|
||||
public function get($name, $default = null, $checkEnv = true)
|
||||
{
|
||||
// if we've not loaded the settings, load them now
|
||||
if (!$this->settings) {
|
||||
@ -65,6 +66,8 @@ class Repository
|
||||
if ($checkEnv) {
|
||||
return $this->settings[$name] = env(strtoupper($name));
|
||||
}
|
||||
|
||||
return $default;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -142,7 +142,7 @@ if (!function_exists('formatted_date')) {
|
||||
*/
|
||||
function formatted_date($date)
|
||||
{
|
||||
$dateFormat = Setting::get('date_format') ?: 'jS F Y';
|
||||
$dateFormat = Setting::get('date_format', 'jS F Y');
|
||||
|
||||
return (new Date($date))->format($dateFormat);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user