Files
alrahma_sunday_school_api/app/Http/Resources/Families/FamilyEmergencyContactResource.php
T
2026-03-10 17:52:47 -04:00

26 lines
936 B
PHP

<?php
namespace App\Http\Resources\Families;
use Illuminate\Http\Resources\Json\JsonResource;
class FamilyEmergencyContactResource extends JsonResource
{
public function toArray($request): array
{
return [
'id' => (int) ($this['id'] ?? 0),
'parent_id' => (int) ($this['parent_id'] ?? 0),
'parent_label' => (string) ($this['parent_label'] ?? ''),
'emergency_contact_name' => (string) ($this['emergency_contact_name'] ?? ''),
'relation' => (string) ($this['relation'] ?? ''),
'cellphone' => (string) ($this['cellphone'] ?? ''),
'email' => (string) ($this['email'] ?? ''),
'school_year' => (string) ($this['school_year'] ?? ''),
'semester' => (string) ($this['semester'] ?? ''),
'created_at' => $this['created_at'] ?? null,
'updated_at' => $this['updated_at'] ?? null,
];
}
}