Show user info about mandatory updates.

This commit is contained in:
James Cole
2021-06-08 19:19:56 +02:00
parent 81669bfcc1
commit 9873365369
7 changed files with 114 additions and 5 deletions

View File

@@ -46,7 +46,7 @@ class FireflyConfig
Cache::forget($fullName);
}
try {
Configuration::where('name', $name)->delete();
Configuration::where('name', $name)->forceDelete();
} catch (Exception $e) { // @phpstan-ignore-line
// @ignoreException
}
@@ -138,7 +138,7 @@ class FireflyConfig
public function set(string $name, $value): Configuration
{
try {
$config = Configuration::whereName($name)->first();
$config = Configuration::whereName($name)->whereNull('deleted_at')->first();
} catch (QueryException | Exception $e) { // @phpstan-ignore-line
$item = new Configuration;
$item->name = $name;
@@ -146,12 +146,12 @@ class FireflyConfig
return $item;
}
if (null === $config) {
$item = new Configuration;
$item->name = $name;
$item->data = $value;
$item->save();
Cache::forget('ff-config-' . $name);
return $item;