public function view_profile($doc_name, $doc_id) { try { $doctor = Doctors::find($doc_id); $img = Images::where('user_id', $doctor->user_id)->first(); $main_doc_ob['image_data'] = $img; $main_doc_ob['doctor_data'] = $doctor; if ($doctor->doc_type == "FORMAL") { $main_doc_ob['doc_type'] = "FORMAL"; $formal = Formal_doctors::where('doctor_id', $doctor->id)->first(); $main_doc_ob['formal_data'] = $formal; } else { $main_doc_ob['doc_type'] = "NON_FORMAL"; $non_formal = Non_Formal_doctors::where('doctor_id', $doctor->id)->first(); $main_doc_ob['non_formal_data'] = $non_formal; } $spec = Specialization::where('doc_id', $doctor->id)->first(); $treat = Treatments::where('doc_id', $doctor->id)->first(); $main_doc_ob['spec_data'] = $spec; $main_doc_ob['treat_data'] = $treat; } catch (Exception $e) { $this->LogError('View Doctor Profile', $e); } /* Run Recently Viewed Profiles */ self::RecentlyViewedProfiles($doc_id); /* Add new hit to Profile View hit counter */ self::ProfileViewHitCounter($doc_id); return View::make('profile', array('doctor' => $main_doc_ob)); }