File: D:/HostingSpaces/SBogers10/shop.komma.nl/app/Shipments/Resources/Shipment.php
<?php declare(strict_types=1);
namespace App\Shipments\Resources;
use App\Orders\Resources\Order;
use App\ShipmentGroups\Resources\ShipmentGroup;
use Illuminate\Http\Resources\Json\JsonResource;
/**
* Class Shipment
*
* @mixin \App\Shipments\Shipment
* @package App\Shipments\Resources
*/
class Shipment extends JsonResource
{
/**
* Transform the resource into an array.
*
* @param \Illuminate\Http\Request
* @return array
*/
public function toArray($request)
{
return [
'id' => $this->id,
'status' => $this->status,
'tracking_code' => $this->tracking_code,
'tracking_url' => $this->tracking_url,
'carrier_name' => $this->carrier_name,
'comment' => $this->comment,
'order' => new Order($this->whenLoaded('order')),
'can_be_announced' => $this->can_be_announced,
'is_announced' => $this->is_announced,
'ssp_reference' => $this->ssp_reference,
'created_at' => $this->created_at,
'updated_at' => $this->updated_at,
];
}
}