ifnex/04_Laravel/app/Enums/ShipmentStatus.php
Kazem Alghasi b051ce4496 feat(shipment): expand schema and enhance PDF generation
Extend the shipment database schema to support additional tracking fields,
state information, and financial data. This update also transitions
shipment documentation from RTL/Persian to LTR/English layouts and
integrates barcode generation for AWB and labels.

- feat(db): add migration for missing shipment fields (state, cod_amount,
  declared_value, etc.)
- feat(shipment): update Shipment model with new casts and helper methods
- feat(ui): refactor Filament resource to use ShipmentStatus enum and
  add new input fields
- feat(pdf): implement barcode generation using picqer/php-barcode-generator
- feat(pdf): redesign AWB, Invoice, and Label templates for LTR/English
  support
- refactor(enum): simplify ShipmentStatus enum and update labels/colors
- chore(deps): add picqer/php-barcode-generator dependency
2026-08-23 22:31:58 +03:30

50 lines
1.4 KiB
PHP

<?php
namespace App\Enums;
enum ShipmentStatus: string
{
case PendingPayment = 'pending_payment';
case Cancelled = 'cancelled';
case Processed = 'processed';
case PickedUp = 'picked_up';
case InTransit = 'in_transit';
case OutForDelivery = 'out_for_delivery';
case Failed = 'failed';
case Delivered = 'delivered';
case Returned = 'returned';
case Archived = 'archived';
public function label(): string
{
return match ($this) {
self::PendingPayment => 'در انتظار پرداخت',
self::Cancelled => 'لغو شده',
self::Processed => 'Processed',
self::PickedUp => 'Picked Up',
self::InTransit => 'In Transit',
self::OutForDelivery => 'Out For Delivery',
self::Failed => 'Failed',
self::Delivered => 'Delivered',
self::Returned => 'Returned',
self::Archived => 'آرشیو',
};
}
public function color(): string
{
return match ($this) {
self::PendingPayment => 'warning',
self::Cancelled => 'danger',
self::Processed => 'gray',
self::PickedUp => 'info',
self::InTransit => 'primary',
self::OutForDelivery => 'success',
self::Failed => 'danger',
self::Delivered => 'success',
self::Returned => 'warning',
self::Archived => 'gray',
};
}
}