add more controller
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Resources\EmergencyContacts;
|
||||
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
|
||||
class EmergencyContactGroupResource extends JsonResource
|
||||
{
|
||||
public function toArray($request): array
|
||||
{
|
||||
return [
|
||||
'parent_id' => (int) ($this['parent_id'] ?? 0),
|
||||
'parent_name' => (string) ($this['parent_name'] ?? ''),
|
||||
'parent_phones' => array_values($this['parent_phones'] ?? []),
|
||||
'students' => EmergencyContactStudentResource::collection($this['students'] ?? []),
|
||||
'contacts' => EmergencyContactResource::collection($this['contacts'] ?? []),
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user