diff --git a/app/Form/Actions/ClearFrontendCacheAction.php b/app/Form/Actions/ClearFrontendCacheAction.php new file mode 100644 index 00000000..d62da43d --- /dev/null +++ b/app/Form/Actions/ClearFrontendCacheAction.php @@ -0,0 +1,17 @@ +clearCacheUrl); + } +} diff --git a/app/Form/Actions/FormDestroyAction.php b/app/Form/Actions/FormDestroyAction.php index 31cb1d8d..ed215382 100644 --- a/app/Form/Actions/FormDestroyAction.php +++ b/app/Form/Actions/FormDestroyAction.php @@ -14,6 +14,8 @@ class FormDestroyAction { $form->delete(); + ClearFrontendCacheAction::run(); + Succeeded::message('Veranstaltung gelöscht.')->dispatch(); } } diff --git a/app/Form/Actions/FormStoreAction.php b/app/Form/Actions/FormStoreAction.php index 2d32e64b..14bd1241 100644 --- a/app/Form/Actions/FormStoreAction.php +++ b/app/Form/Actions/FormStoreAction.php @@ -45,6 +45,7 @@ class FormStoreAction return tap(Form::create($attributes), function ($form) { $form->setDeferredUploads(request()->input('header_image')); $form->setDeferredUploads(request()->input('mailattachments')); + ClearFrontendCacheAction::run(); }); } diff --git a/app/Form/Actions/FormUpdateAction.php b/app/Form/Actions/FormUpdateAction.php index d682048b..1069e449 100644 --- a/app/Form/Actions/FormUpdateAction.php +++ b/app/Form/Actions/FormUpdateAction.php @@ -42,6 +42,9 @@ class FormUpdateAction public function handle(Form $form, array $attributes): Form { $form->update($attributes); + + ClearFrontendCacheAction::run(); + return $form; } diff --git a/app/Form/Actions/SettingIndexAction.php b/app/Form/Actions/SettingIndexAction.php index 3170afdd..009c48f7 100644 --- a/app/Form/Actions/SettingIndexAction.php +++ b/app/Form/Actions/SettingIndexAction.php @@ -19,6 +19,7 @@ class SettingIndexAction return [ 'data' => [ 'register_url' => $settings->registerUrl, + 'clear_cache_url' => $settings->clearCacheUrl, ], ]; } diff --git a/app/Form/Actions/SettingStoreAction.php b/app/Form/Actions/SettingStoreAction.php index 509f3128..25f9897a 100644 --- a/app/Form/Actions/SettingStoreAction.php +++ b/app/Form/Actions/SettingStoreAction.php @@ -20,6 +20,7 @@ class SettingStoreAction $settings->fill([ 'registerUrl' => $input['register_url'], + 'clearCacheUrl' => $input['clear_cache_url'], ]); $settings->save(); @@ -32,6 +33,7 @@ class SettingStoreAction { return [ 'register_url' => 'present|string', + 'clear_cache_url' => 'present|string', ]; } diff --git a/app/Form/FormSettings.php b/app/Form/FormSettings.php index 5e596d03..7ca1636b 100644 --- a/app/Form/FormSettings.php +++ b/app/Form/FormSettings.php @@ -11,6 +11,7 @@ use App\Setting\LocalSettings; class FormSettings extends LocalSettings implements Indexable, Storeable { public string $registerUrl; + public string $clearCacheUrl; public static function group(): string { diff --git a/database/settings/2024_06_09_235516_add_clear_cache_url_setting.php b/database/settings/2024_06_09_235516_add_clear_cache_url_setting.php new file mode 100644 index 00000000..68849291 --- /dev/null +++ b/database/settings/2024_06_09_235516_add_clear_cache_url_setting.php @@ -0,0 +1,11 @@ +migrator->add('form.clearCacheUrl', ''); + } +}; diff --git a/resources/js/views/setting/Form.vue b/resources/js/views/setting/Form.vue index 4d374621..510040b8 100644 --- a/resources/js/views/setting/Form.vue +++ b/resources/js/views/setting/Form.vue @@ -10,6 +10,7 @@