<?php

namespace App\Http\Resources\Mobile;

use Illuminate\Http\Resources\Json\JsonResource;

class WorkerSchedules 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,
            'project_name' => $this->project_name,
            'status'       => $this->status,
            'total_hours'  => $this->total_hours,
            'company_name' => $this->company_name,
            'clock_in'     => $this->clock_in,
            'clock_out'    => $this->clock_out,
            'location'     => json_decode($this->location),
            'date'         => $this->date,
            'worker_items' => $this->worker_items,
            'additional_info' => $this->additional_info,
            'message' => $this->message,
        ];
    }
}
