<?php

namespace Modules\Project\Models\Resources;

use Illuminate\Http\Resources\Json\JsonResource;

class ProjectResource extends JsonResource
{
    public function toArray($request)
    {
        return [
            'id' => $this->id,
            'image' => $this->image_url,
            'title' => optional($this->currentDescription)->title,
            'description' => optional($this->currentDescription)->description,
            'project_date' => $this->project_date,
            'created_at' => $this->created_at,
        ];
    }
}
