2023-12-30 01:00:58 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Form\Fields;
|
|
|
|
|
|
|
|
use Faker\Generator;
|
|
|
|
|
|
|
|
class DateField extends Field
|
|
|
|
{
|
|
|
|
public static function name(): string
|
|
|
|
{
|
|
|
|
return 'Datum';
|
|
|
|
}
|
|
|
|
|
|
|
|
public static function meta(): array
|
|
|
|
{
|
|
|
|
return [
|
|
|
|
['key' => 'required', 'default' => false, 'rules' => ['required' => 'present|boolean'], 'label' => 'Erforderlich'],
|
|
|
|
['key' => 'max_today', 'default' => false, 'rules' => ['required' => 'present|boolean'], 'label' => 'Nur daten bis heute erlauben'],
|
|
|
|
];
|
|
|
|
}
|
|
|
|
|
2024-02-03 17:51:27 +01:00
|
|
|
public static function default(): ?string
|
2023-12-30 01:00:58 +01:00
|
|
|
{
|
2024-02-03 17:51:27 +01:00
|
|
|
return null;
|
2023-12-30 01:00:58 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
public static function fake(Generator $faker): array
|
|
|
|
{
|
|
|
|
return [
|
|
|
|
'required' => $faker->boolean(),
|
|
|
|
'max_today' => $faker->boolean(),
|
|
|
|
];
|
|
|
|
}
|
|
|
|
}
|