HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
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,
        ];
    }
}