20-02-2026
This commit is contained in:
parent
854ce02bf6
commit
4d6b4930b2
128 changed files with 18247 additions and 2093 deletions
37
app/Enums/ProductStatus.php
Normal file
37
app/Enums/ProductStatus.php
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
<?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',
|
||||
};
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue