Merge remote-tracking branch 'origin/master' into mhmfajar

This commit is contained in:
Muhammad Fajar
2022-11-03 05:12:56 +07:00
5 changed files with 85 additions and 12 deletions

View File

@@ -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'),
];
}
}