adrema/app/Prevention/PreventionSettings.php

54 lines
968 B
PHP

<?php
namespace App\Prevention;
use App\Lib\Editor\EditorData;
use App\Setting\Contracts\Storeable;
use App\Setting\LocalSettings;
use Lorisleiva\Actions\ActionRequest;
class PreventionSettings extends LocalSettings implements Storeable
{
public EditorData $formmail;
public static function group(): string
{
return 'prevention';
}
public static function title(): string
{
return 'Prävention';
}
/**
* @inheritdoc
*/
public function rules(): array
{
return [
'formmail' => 'required',
];
}
public function saveAttributes(ActionRequest $request): array
{
return [
'formmail' => EditorData::from($request->formmail),
];
}
/**
* @inheritdoc
*/
public function viewData(): array
{
return [
'data' => [
'formmail' => $this->formmail,
]
];
}
}