<?php

namespace App\Http\Resources\Company;

use Illuminate\Http\Resources\Json\JsonResource;

class WorkerReview 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,
            'worker_id' => $this->worker_id,
            'message' => $this->message,
            'rate' => $this->rate,
            'created_at' => date('F d, Y h:i A', strtotime($this->created_at)),
            'company_name' => $this->company_name,
        ];
    }
}
