<?php

namespace App\Http\Resources;

use Illuminate\Http\Request;
use Illuminate\Http\Resources\Json\JsonResource;

class ProfileResource extends JsonResource
{
    public function toArray(Request $request): array
    {
        return [
            'id' => $this->id,
            'history' => $this->history,
            'history_image_url' => $this->history_image ? asset('storage/' . $this->history_image) : null,
            'vision' => $this->vision,
            'mission' => $this->mission,
            'contact_info' => $this->contact_info,
            'created_at' => $this->created_at?->toISOString(),
            'updated_at' => $this->updated_at?->toISOString(),
        ];
    }
}
