migrate to gtea from bistbucket
This commit is contained in:
49
public/restaurant/app/Enum/TrackingStatus.php
Normal file
49
public/restaurant/app/Enum/TrackingStatus.php
Normal file
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
namespace App\Enum;
|
||||
|
||||
enum TrackingStatus: string
|
||||
{
|
||||
case Placed = 'placed';
|
||||
case Accepted = 'accepted';
|
||||
case Preparing = 'preparing';
|
||||
case Dispatched = 'dispatched';
|
||||
case Delivered = 'delivered';
|
||||
case Cancelled = 'cancelled';
|
||||
|
||||
// Optional constants
|
||||
public const PLACED = 'placed';
|
||||
|
||||
public const ACCEPTED = 'accepted';
|
||||
|
||||
public const PREPARING = 'preparing';
|
||||
|
||||
public const DISPATCHED = 'dispatched';
|
||||
|
||||
public const DELIVERED = 'delivered';
|
||||
|
||||
public const CANCELLED = 'cancelled';
|
||||
|
||||
/**
|
||||
* Get all enum values
|
||||
*/
|
||||
public static function values(): array
|
||||
{
|
||||
return array_column(self::cases(), 'value');
|
||||
}
|
||||
|
||||
/**
|
||||
* UI Labels
|
||||
*/
|
||||
public static function labels(): array
|
||||
{
|
||||
return [
|
||||
self::Placed->value => 'Placed',
|
||||
self::Accepted->value => 'Accepted',
|
||||
self::Preparing->value => 'Preparing',
|
||||
self::Dispatched->value => 'Dispatched',
|
||||
self::Delivered->value => 'Delivered',
|
||||
self::Cancelled->value => 'Cancelled',
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user