fixed maintenance

This commit is contained in:
vedatakdogan 2020-12-22 19:04:56 +03:00
parent 765f7017ca
commit 59acc04831
2 changed files with 24 additions and 0 deletions

View File

@ -0,0 +1,21 @@
<?php namespace App\Listeners;
use Anomaly\SettingsModule\Setting\Form\SettingFormRepository;
use Anomaly\Streams\Platform\Ui\Form\Event\FormWasSaved;
class RunForSavedForm
{
public function handle(FormWasSaved $event)
{
$builder = $event->getBuilder();
if (get_class($builder->getRepository()) === SettingFormRepository::class) {
if ($builder->getFormValues()->has('maintenance') and $builder->getFormValues()->get('maintenance')) {
file_put_contents(storage_path('framework/down'),
json_encode(['time' => '', 'retry' => null, 'message' => null],
JSON_PRETTY_PRINT));
}
}
}
}

View File

@ -17,6 +17,9 @@ return [
\Anomaly\Streams\Platform\Event\Booted::class => [
\App\Listeners\Translations::class
],
\Anomaly\Streams\Platform\Ui\Form\Event\FormWasSaved::class => [
\App\Listeners\RunForSavedForm::class
],
],
/*