<?php

namespace App\Http\Resources\Company;

use Illuminate\Http\Resources\Json\JsonResource;

class BorrowCancelledRequestDetails extends JsonResource
{
    /**
     * Transform the resource into an array.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return array|\Illuminate\Contracts\Support\Arrayable|\JsonSerializable
     */
    public function toArray($request)
    {
        return [
            'id' => $this->id,
            'cancelled_date' => $this->cancelled_date,
            'cancelled_by' => $this->cancelled_by_first_name.' '.$this->cancelled_by_last_name,
            'date_requested' => $this->date_requested,
            'date_from' => $this->date_from,
            'date_to' => $this->date_to,
            'requested_by' => $this->requester_first_name.' '.$this->requester_last_name,
            'requester_note' => $this->requester_note,
            'worker_id' => $this->worker_id,
            'company_worker_id' => $this->company_worker_id,
            'rate' => $this->rate,
            'street_address' => $this->street_address,
            'city' => $this->city,
            'state' => $this->state,
            'zipcode' => $this->zipcode,
        ];
    }
}
