> */ private array $documents = [ DvDocument::class, SolingenDocument::class, RemscheidDocument::class, ]; /** * @return Collection */ public function compilerSelect(): Collection { return collect($this->documents)->map(fn ($document) => [ 'title' => $document::getName(), 'class' => $document, ]); } /** * @return array */ public function typeRule(): array { return [ 'type' => ['required', Rule::in($this->documents)], ]; } /** * @param class-string $type * * @return array */ public function rules(string $type): array { return [ ...$type::globalRules(), ...$type::rules(), ]; } }