<?php

namespace App\Http\Resources\Families;

use Illuminate\Http\Resources\Json\JsonResource;

class FamilySearchItemResource extends JsonResource
{
    public function toArray($request): array
    {
        return [
            'type' => (string) ($this['type'] ?? ''),
            'id' => (int) ($this['id'] ?? 0),
            'label' => (string) ($this['label'] ?? ''),
            'sub' => (string) ($this['sub'] ?? ''),
        ];
    }
}
