*/ public array $options; public static function name(): string { return 'Checkboxes'; } public static function meta(): array { return [ ['key' => 'options', 'default' => [], 'rules' => ['options' => 'array', 'options.*' => 'required|string'], 'label' => 'Optionen'], ]; } public static function default() { return []; } public static function fake(Generator $faker): array { return [ 'options' => $faker->words(4), ]; } /** * @inheritdoc */ public function getRegistrationRules(Form $form): array { return [ $this->key => 'array', $this->key . '.*' => ['string', Rule::in($this->options)], ]; } /** * @inheritdoc */ public function getRegistrationAttributes(Form $form): array { return [ ...collect($this->options)->mapWithKeys(fn ($option, $key) => [$this->key . '.' . $key => $this->name])->toArray(), $this->key => $this->name, ]; } /** * @inheritdoc */ public function getRegistrationMessages(Form $form): array { return []; } public function getPresenter(): Presenter { return app(EnumPresenter::class); } /** * @inheritdoc */ public function afterRegistration(Form $form, Participant $participant, array $input): void { } }