mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Force fresh config var [skip ci]
This commit is contained in:
@@ -77,6 +77,27 @@ class FireflyConfig
|
||||
return $this->set($name, $default);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $name
|
||||
* @param null $default
|
||||
*
|
||||
* @return \FireflyIII\Models\Configuration|null
|
||||
*/
|
||||
public function getFresh($name, $default = null)
|
||||
{
|
||||
$config = Configuration::where('name', $name)->first(['id', 'name', 'data']);
|
||||
if ($config) {
|
||||
|
||||
return $config;
|
||||
}
|
||||
// no preference found and default is null:
|
||||
if (null === $default) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $this->set($name, $default);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $name
|
||||
* @param $value
|
||||
|
||||
Reference in New Issue
Block a user