Files
alrahma_sunday_school_api/app/Http/Resources/Parents/ParentEmergencyContactResource.php
T
2026-03-10 00:48:32 -04:00

22 lines
637 B
PHP

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