public function get($id) { $doctor = Doctor::with(['companions', 'episodes'])->find($id); $ratings = Rating::getRating('doctor', $id); $comments = Comment::where('item_id', $id)->where('item_type', 'doctor')->with('user')->orderBy('created_at', 'desc')->get(); return View::make('items.doctor', ['doctor' => $doctor, 'ratings' => $ratings, 'comments' => $comments]); }
public function show($id) { $doctor = Doctor::with('clinics', 'contacts', 'specializations')->find($id); if ($doctor) { return Response::json(['msg' => 'valid', 'doctor' => $doctor]); } else { return Response::invalid(); } }
public function get_doctors() { $doctors = Doctor::with('speciality')->get(); return Response::json(array('doctors' => $doctors)); }