🔄 در حال انجام: تست دستی Filament ⏸️ بلاک: مهاجرت ۳۹۵۰ رکورد (منتظر فایل اکسل اصلاحشده) ⏸️ بلاک: پلاگین وردپرس (بعد از تست کامل API)
43 lines
994 B
PHP
43 lines
994 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
class ShipmentTrackingEvent extends Model
|
|
{
|
|
protected $fillable = [
|
|
'shipment_id',
|
|
'event_date',
|
|
'event_time',
|
|
'location',
|
|
'event_description',
|
|
'delivery_status',
|
|
'source',
|
|
'carrier_mapping_id',
|
|
'raw_payload',
|
|
];
|
|
|
|
protected function casts(): array
|
|
{
|
|
return [
|
|
'event_date' => 'date',
|
|
'event_time' => 'datetime:H:i',
|
|
'delivery_status' => \App\Enums\ShipmentStatus::class,
|
|
'source' => \App\Enums\TrackingSource::class,
|
|
'raw_payload' => 'array',
|
|
];
|
|
}
|
|
|
|
public function shipment(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Shipment::class);
|
|
}
|
|
|
|
public function carrierMapping(): BelongsTo
|
|
{
|
|
return $this->belongsTo(ShipmentCarrierMapping::class, 'carrier_mapping_id');
|
|
}
|
|
}
|