[WIP] Fix Person
This commit is contained in:
@@ -16,10 +16,6 @@ class PersonResource extends JsonResource
|
||||
public function toArray($request)
|
||||
{
|
||||
return [
|
||||
'avatar' => [
|
||||
'title' => $this->avatar->name ?? '',
|
||||
'url' => url($this->avatar->path) ?? '',
|
||||
],
|
||||
'id' => $this->id,
|
||||
'name' => $this->name,
|
||||
'birth_place' => $this->birth_place,
|
||||
@@ -29,12 +25,13 @@ class PersonResource extends JsonResource
|
||||
'blood_type' => $this->blood_type,
|
||||
'weight' => $this->weight,
|
||||
'height' => $this->height,
|
||||
'relation_with_owner' => $this->relation_with_owner,
|
||||
'relation_with_owner' => ($this->user && $this->user->person_id == $this->id) ? 'Self' : $this->pivot->relation_with_owner ?? null,
|
||||
'marital_status' => $this->marital_status,
|
||||
'last_education' => $this->last_education,
|
||||
'current_employment' => $this->current_employment,
|
||||
'nik' => $this->nik,
|
||||
'religion' => $this->religion,
|
||||
'avatar_url' => $this->avatar->url ?? asset('images/default-doctor-avatar.png'),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user