/** * Display the specified resource. * * @param int $id * @return Response */ public function show($id) { $doctor = Doctor::find($id); if (!$doctor) { return response()->json(['error' => ['message' => "Doctor doesn't exists"]], 404); } return response()->json(['data' => $doctor->toArray()], 200); }
public function actionList() { $model = Doctor::find()->all(); return $this->renderPartial('list', ['model' => $model]); }
public function actionAppointment() { $listDepartment = ArrayHelper::map(Department::find()->where('enabled<>0')->all(), 'id', 'name'); $listChannel = ArrayHelper::map(Channel::find()->where('enabled<>0')->all(), 'id', 'name'); $listDoctor = ArrayHelper::map(Doctor::find()->where('enabled<>0')->all(), 'id', 'name'); $listUser = ArrayHelper::map(User::find()->where('enabled<>0')->all(), 'id', 'username'); return $this->render('appointment', ['model' => new Record(), 'listDepartment' => $listDepartment, 'listChannel' => $listChannel, 'listDoctor' => $listDoctor, 'listUser' => $listUser]); }