*/ public function rules(): array { return [ ...$this->globalRules(), 'description' => 'required|string', 'excerpt' => 'required|string|max:130', 'from' => 'required|date', 'to' => 'required|date', 'registration_from' => 'present|nullable|date', 'registration_until' => 'present|nullable|date', 'mail_top' => 'nullable|string', 'mail_bottom' => 'nullable|string', ]; } /** * @param array $attributes */ public function handle(Form $form, array $attributes): Form { $form->update($attributes); return $form; } /** * @return array */ public function getValidationAttributes(): array { return [ ...$this->globalValidationAttributes(), 'from' => 'Start', 'to' => 'Ende', ]; } public function asController(Form $form, ActionRequest $request): JsonResponse { $this->handle($form, $request->validated()); Succeeded::message('Veranstaltung aktualisiert.')->dispatch(); return response()->json([]); } }