add family logic

This commit is contained in:
root
2026-03-10 17:52:47 -04:00
parent a82f7aedbc
commit 17d73e2f92
37 changed files with 2611 additions and 2 deletions
@@ -0,0 +1,25 @@
<?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,
];
}
}