public function createUser(RegisterRequest $request) { if (Auth::user()->guest) { $user = User::create(['name' => $request['name'], 'email' => $request['email'], 'password' => bcrypt($request['password']), 'birthday' => $request['birthday'], 'admin' => false]); $user->parent()->associate(users::where('email', '=', $request['parentEmail'])); $user->save(); } else { return view('users.edit'); } }
public function showPrescription(Request $request) { $userId = $request['userId']; $prescription = users::where('userId', $userId)->join('appointment', 'users.userId', '=', 'appointment.patientId')->join('prescription', 'appointment.appointmentId', '=', 'prescription.appointmentId')->last(); //return view('pharmacist.recordPrescriptionHistory',compact('prescription')); }
public function createAppointmentStaff($userId) { $patient = users::where('userId', $userId)->first(); return view('staff.createAppointmentForPatient2')->with('patient', $patient); }