'erweitertes Führungszeugnis', static::PS => 'Präventionsschulung Basis Plus', static::MOREPS => 'Präventionsschulung (Auffrischung)', static::VK => 'Verhaltenskodex', }; } public function tooltip(bool $value): string { return $this->text() . ' ' . ($value ? 'vorhanden' : 'nicht vorhanden'); } public function letter(): string { return match ($this) { static::EFZ => 'F', static::PS => 'P', static::MOREPS => 'A', static::VK => 'V', }; } /** * @param Collection $preventions * @return Collection */ public static function items(Collection $preventions): Collection { return collect(static::cases())->map(fn($case) => [ 'letter' => $case->letter(), 'value' => $preventions->pluck('type')->doesntContain($case), 'tooltip' => $case->tooltip($preventions->pluck('type')->doesntContain($case)), ]); } }