35 lines
926 B
PHP
35 lines
926 B
PHP
<?php
|
|
|
|
namespace App\Enums;
|
|
|
|
use Filament\Support\Contracts\HasLabel;
|
|
|
|
enum PhotoCategory: string implements HasLabel
|
|
{
|
|
case Apartment = 'apartment';
|
|
case Outdoor = 'outdoor';
|
|
case Area = 'area';
|
|
/** Floor plans and drawings: chosen explicitly (e.g. for the interactive floor plan), never shown in galleries. */
|
|
case Plan = 'plan';
|
|
|
|
public function getLabel(): string
|
|
{
|
|
return match ($this) {
|
|
self::Apartment => 'Wohnung',
|
|
self::Outdoor => 'Terrasse & Garten',
|
|
self::Area => 'Kühlungsborn & Umgebung',
|
|
self::Plan => 'Grundriss & Pläne',
|
|
};
|
|
}
|
|
|
|
/**
|
|
* Categories a gallery or an automatic photo may show.
|
|
*
|
|
* @return list<self>
|
|
*/
|
|
public static function forGalleries(): array
|
|
{
|
|
return array_values(array_filter(self::cases(), fn (self $category): bool => $category !== self::Plan));
|
|
}
|
|
}
|