b2in/app/Enums/ProductStatus.php
2026-02-20 17:57:50 +01:00

37 lines
901 B
PHP

<?php
namespace App\Enums;
enum ProductStatus: string
{
case Draft = 'draft';
case Pending = 'pending';
case Correction = 'correction';
case Active = 'active';
case Archived = 'archived';
case Sold = 'sold';
public function label(): string
{
return match ($this) {
self::Draft => 'Entwurf',
self::Pending => 'In Prüfung',
self::Correction => 'Korrektur nötig',
self::Active => 'Freigegeben',
self::Archived => 'Archiviert',
self::Sold => 'Verkauft',
};
}
public function color(): string
{
return match ($this) {
self::Draft => 'yellow',
self::Pending => 'blue',
self::Correction => 'orange',
self::Active => 'green',
self::Archived => 'zinc',
self::Sold => 'red',
};
}
}