26 lines
729 B
PHP
26 lines
729 B
PHP
<?php
|
|
|
|
namespace Modules\User\Transformers;
|
|
|
|
use Illuminate\Http\Request;
|
|
use Illuminate\Http\Resources\Json\JsonResource;
|
|
|
|
class HeirResource extends JsonResource
|
|
{
|
|
public function toArray(Request $request): array
|
|
{
|
|
return [
|
|
'id' => $this->id,
|
|
'user_id' => $this->user_id,
|
|
'name' => $this->name,
|
|
'ic_number' => $this->ic_number,
|
|
'relationship' => $this->relationship,
|
|
'phone_number' => $this->phone_number,
|
|
'address' => $this->address,
|
|
'is_primary' => $this->is_primary,
|
|
'created_at' => $this->created_at?->toISOString(),
|
|
'updated_at' => $this->updated_at?->toISOString(),
|
|
];
|
|
}
|
|
}
|