update 20.10.2025

This commit is contained in:
Kevin Adametz 2025-10-20 17:42:08 +02:00
parent 8c11130b5d
commit a939cd51ef
616 changed files with 84821 additions and 4121 deletions

View file

@ -26,12 +26,17 @@ class DhlShipment extends Model
'label_format',
'label_path',
'status',
'firstname',
'lastname',
'company',
'recipient',
'tracking_status',
'last_tracked_at',
'api_response_data'
];
protected $casts = [
'recipient' => 'array',
'api_response_data' => 'array',
'last_tracked_at' => 'datetime',
'weight_kg' => 'decimal:3'
@ -48,6 +53,7 @@ class DhlShipment extends Model
'unknown' => 'unknown'
];
/**
* Get the tracking events for this shipment
*/
@ -146,4 +152,36 @@ class DhlShipment extends Model
{
return $this->status === 'delivered';
}
/**
* Get translated status for current locale
*/
public function getStatusTranslation(): string
{
return __('dhl.status.' . $this->status, [], $this->status);
}
/**
* Get translated status for any status
*/
public static function getStatusTranslationFor(string $status): string
{
return __('dhl.status.' . $status, [], $status);
}
/**
* Get translated type for current locale
*/
public function getTypeTranslation(): string
{
return __('dhl.type.' . $this->type, [], $this->type);
}
/**
* Get translated product code for current locale
*/
public function getProductCodeTranslation(): string
{
return __('dhl.product_codes.' . $this->product_code, [], $this->product_code);
}
}