<?php

namespace App\Http\Resources;

use Illuminate\Http\Resources\Json\JsonResource;

class TransactionDetailResource extends JsonResource
{
    /**
     * Transform the resource into an array.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return array
     */
    public function toArray($request)
    {
        
        return [
            'reference' => $this->reference,
            'quantity' => $this->quantity,
            'price' => (double) $this->price,
            'name' => $this->name,
            'amount' => (double) $this->amount
        ];
    }
}
