public function edit($id)
 {
     $user = User::find($id);
     $specializations = DoctorsSpecialization::lists('name', 'id');
     $data = ['user' => $user, 'specializations' => $specializations];
     return view('frontend.management.edit-doctor', $data);
 }
 public function report($id)
 {
     $doctor = auth()->user();
     //Get all reports assigned to this doctor
     if ($reports = Reports::where('assigned_doctor_id', $doctor->id)->where('reports.id', $id)->join('users', 'user_id', '=', 'users.id')->first(['*', 'reports.updated_at AS report_date', 'reports.id AS reportID'])) {
         $previous_complaints = Reports::where('user_id', $reports->user_id)->where('id', '!=', $reports->reportID)->get();
         $recommendation = Recommendation::where('report_id', $id)->orderBy('id', 'DESC')->first();
         //Get current recommendation(s) for this post
         $doctors = ['--Select Specialization--'] + DoctorsSpecialization::lists('name', 'id')->toArray();
         $data = ['report' => $reports, 'id' => $id, 'recommendation' => $recommendation, 'doctors' => $doctors, 'previous_complaints' => $previous_complaints];
         return view('frontend.doctor.report', $data);
     } else {
         abort(404);
     }
 }