<?php

namespace App\Http\Resources;

use Illuminate\Http\Resources\Json\JsonResource;

class CurrencyRateLogResource extends JsonResource
{
    /**
     * Transform the resource into an array.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return array
     */
    public function toArray($request)
    {
        $currencyRate = $this->currencyRate;

        return [
            'currency_rate_id' => $this->currency_rate_id,
            'rate' => $this->selling,
            'created_at' => $this->created_at->format('d-m-Y'),
            'payment_method_type' => $currencyRate->payment_method_type,
        ];
    }
}
