<?php

namespace Modules\ChipOrder\Resources\Api;

use Illuminate\Http\Resources\Json\JsonResource;
use Modules\Chip\Resources\Api\ChipResource;

class ChipOrderDetailsResource extends JsonResource
{

    /**
     * Transform the resource into an array.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return array
     */
    public function toArray($request)
    {
        return [
            'id' => (int) $this->id,
            'count' => (int) $this->count,
            'price' => (double) $this->price,
            'chip' => new ChipResource($this->chip)
        ];
    }

}
