<?php

namespace App\Http\Resources;

use Illuminate\Http\Resources\Json\JsonResource;

class Package extends JsonResource
{
    /**
     * Transform the resource into an array.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return array
     */
    public function toArray($request)
    {
        return [
            'description' => $this->description,
            'type' => (int)$this->type,
            'width' => (float)$this->width,
            'length' => (float)$this->length,
            'height' => (float)$this->height,
            'quantity' => (int)$this->quantity
        ];
    }
}
