Parcourir la source

feat: add document_number and birth_date fields to StudentSelectResource

ebagabee il y a 1 semaine
Parent
commit
a8aa787a15
1 fichiers modifiés avec 6 ajouts et 1 suppressions
  1. 6 1
      app/Http/Resources/Select/StudentSelectResource.php

+ 6 - 1
app/Http/Resources/Select/StudentSelectResource.php

@@ -9,6 +9,11 @@ class StudentSelectResource extends JsonResource
 {
     public function toArray(Request $request): array
     {
-        return ['id' => $this->id, 'name' => $this->name];
+        return [
+            'id' => $this->id,
+            'name' => $this->name,
+            'document_number' => $this->document_number,
+            'birth_date' => $this->birth_date?->format('Y-m-d'),
+        ];
     }
 }