adrema/app/Form/Fields/DateField.php

35 lines
790 B
PHP
Raw Normal View History

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'],
];
}
public static function default(): string
{
return '';
}
public static function fake(Generator $faker): array
{
return [
'required' => $faker->boolean(),
'max_today' => $faker->boolean(),
];
}
}