'description', 'default' => '', 'rules' => ['description' => 'required|string'], 'label' => 'Beschreibung'], ['key' => 'required', 'default' => true, 'rules' => ['required' => 'present|boolean'], 'label' => 'Erforderlich'], ]; } public static function default() { return false; } public static function fake(Generator $faker): array { return [ 'description' => $faker->text(), 'required' => $faker->boolean(), ]; } /** * @inheritdoc */ public function getRegistrationRules(Form $form): array { return [ $this->key => $this->required ? ['boolean', 'accepted'] : ['present', 'boolean'], ]; } /** * @inheritdoc */ public function getRegistrationAttributes(Form $form): array { return [ $this->key => $this->name, ]; } /** * @inheritdoc */ public function getRegistrationMessages(Form $form): array { return []; } /** * @inheritdoc */ public function afterRegistration(Form $form, Participant $participant, array $input): void { } }