Переглянути джерело

feat: add document_number and birth_date fields to StudentSelectResource

ebagabee 1 тиждень тому
батько
коміт
a8aa787a15
1 змінених файлів з 6 додано та 1 видалено
  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'),
+        ];
     }
 }