fix code speciality resource

This commit is contained in:
Muhammad Fajar
2022-11-03 16:08:40 +07:00
parent 6a57b8179a
commit 6e6d9e65ca

View File

@@ -30,13 +30,13 @@ class SpecialityResource extends JsonResource
}
return [
$this->mergeWhen($this->practitioner && $prices, [
$this->mergeWhen($this->practitioner && $this->prices, [
'id' => isset($this->practitioner->person->id) ? $this->practitioner->person->id : $this->practitioner_id,
'name' => isset($this->practitioner->person->name) ? $this->practitioner->person->name : $this->person_name,
'specialis' => 'Spesialis ' . (isset($this->speciality->name) ? $this->speciality->name : $this->speciality_name),
'experience' => rand(5, 12),
'rating' => rand(20, 100),
'price' => $prices ? Helper::currencyIdrFormat($prices) : null,
'price' => isset($prices) ? Helper::currencyIdrFormat($prices) : null,
]),
$this->mergeWhen($this->name, [
'title' => 'Spesialis ' . $this->name,