<?php

namespace App\Http\Resources\Frontend;

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

class ContactSubmissionResource extends JsonResource
{
    public function toArray(Request $request): array
    {
        return [
            'email' => $this->resource['email'] ?? null,
            'email_sent' => (bool) ($this->resource['email_sent'] ?? false),
            'contact_id' => $this->resource['contact_id'] ?? null,
        ];
    }
}
