public function toArray($request)
{
return [
'id' => $this->id,
'name' => $this->name,
'specialities' => SpecialityResource::collection($this->whenLoaded('activeSpecialities')),
];
}
public function toArray($request)
{
return [
'user' => UserResource::make($this->whenLoaded('user')),
'special_price' => $this->special_price,
];
}