diff --git a/src/app/Console/Commands/Scalpel/Wallet/SettingsCommand.php b/src/app/Console/Commands/Scalpel/Wallet/SettingsCommand.php new file mode 100644 --- /dev/null +++ b/src/app/Console/Commands/Scalpel/Wallet/SettingsCommand.php @@ -0,0 +1,14 @@ +cacheKeys as $cacheKey) { + foreach ($object->toArray() as $propKey => $propValue) { + if (!is_object($propValue)) { + $cacheKey = str_replace('%' . $propKey . '%', $propValue, $cacheKey); + } + } + + Cache::forget($cacheKey); + } + } } diff --git a/src/app/Console/ObjectCreateCommand.php b/src/app/Console/ObjectCreateCommand.php --- a/src/app/Console/ObjectCreateCommand.php +++ b/src/app/Console/ObjectCreateCommand.php @@ -56,6 +56,7 @@ $object = $this->objectClass::create($this->properties); if ($object) { + $this->cacheRefresh($object); $this->info($object->{$class->getKeyName()}); } else { $this->error("Object could not be created."); diff --git a/src/app/Console/ObjectUpdateCommand.php b/src/app/Console/ObjectUpdateCommand.php --- a/src/app/Console/ObjectUpdateCommand.php +++ b/src/app/Console/ObjectUpdateCommand.php @@ -92,5 +92,7 @@ $object->timestamps = false; $object->save(['timestamps' => false]); + + $this->cacheRefresh($object); } }