adrema/app/Form/Fields/EmailField.php

23 lines
413 B
PHP
Raw Normal View History

2024-04-12 15:57:53 +02:00
<?php
namespace App\Form\Fields;
use App\Form\Models\Form;
class EmailField extends TextField
{
public static function name(): string
{
return 'E-Mail-Adresse';
}
/**
* @inheritdoc
*/
public function getRegistrationRules(Form $form): array
{
2024-04-13 21:57:58 +02:00
return [$this->key => $this->required ? ['required', 'string', 'email'] : ['nullable', 'email', 'string']];
2024-04-12 15:57:53 +02:00
}
}