Fix some things with the update checker.

This commit is contained in:
James Cole
2018-08-17 21:51:15 +02:00
parent a8080f55f0
commit 81d17409d4
5 changed files with 26 additions and 7 deletions

View File

@@ -118,9 +118,11 @@ class FireflyConfig
public function set(string $name, $value): Configuration
{
Log::debug('Set new value for ', ['name' => $name]);
/** @var Configuration $config */
$config = Configuration::whereName($name)->first();
if (null === $config) {
Log::debug('Does not exist yet ', ['name' => $name]);
/** @var Configuration $item */
$item = new Configuration;
$item->name = $name;
$item->data = $value;
@@ -130,7 +132,7 @@ class FireflyConfig
return $item;
}
Log::debug('Exists already ', ['name' => $name]);
Log::debug('Exists already, overwrite value.', ['name' => $name]);
$config->data = $value;
$config->save();
Cache::forget('ff-config-' . $name);