<?php

namespace App\Http\Resources;

use Illuminate\Http\Resources\Json\JsonResource;

/**
 * @property mixed id
 * @property mixed type
 * @property mixed consulting_date
 * @property mixed consulting_time
 * @property mixed price
 * @property mixed status
 */
class ConsultingResource extends JsonResource
{
    /**
     * Transform the resource into an array.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return array
     */
    public function toArray($request)
    {
        return [
            'id' => $this->id,
            'type' => $this->type,
            'consulting_date' => $this->consulting_date,
            'consulting_time' => date('h:i A', strtotime($this->consulting_time)),
            'price' => $this->price,
            'status' => $this->status,
        ];
    }
}
