public static function deleteStaff($staffId) { $user = user::where('userId', $staffId)->first(); if ($user->userType == 'doctor') { $doctor = doctor::where('userId', $staffId)->first(); $doctor->delete(); } else { if ($user->userType == 'staff') { $staff = staff::where('userId', $staffId)->first(); $staff->delete(); } } $hospitalStaff = hospitalStaff::where('userId', $staffId)->first(); $hospitalStaff->delete(); $user->delete(); }
public function manageStaffShow($staffId) { $staff = hospitalStaff::where('userId', $staffId)->first(); $departments = department::getDepartmentArray(); return view('staff.manageStaffByStaff2')->with('staff', $staff)->with('departments', $departments); }