<?php

namespace App\Http\Resources\Utilities;

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

class PhoneFormatResource extends JsonResource
{
    public function toArray(Request $request): array
    {
        return [
            'raw' => $this->resource['raw'] ?? null,
            'formatted' => $this->resource['formatted'] ?? null,
            'is_valid' => $this->resource['is_valid'] ?? false,
        ];
    }
}
