public function loginDoctor(Request $request) { try { $doctor = new Doctor(); $doctor->strUsername = $request->strUsername; $doctor->strPassword = $request->strPassword; $status = $doctor->login(); if ($status === "success") { session()->put('doctorId', $doctor->getIdByUsername()); return redirect()->action('PatientController@getAllPatient'); } else { return view('landing'); } } catch (Exception $e) { dd($e); } }