Esempio n. 1
0
 /**
  * Handle an incoming request.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  \Closure  $next
  * @return mixed
  */
 public function handle($request, Closure $next)
 {
     if ($this->auth->guest()) {
         if ($request->ajax()) {
             return response('Unauthorized.', 401);
         } else {
             return redirect()->guest('auth/login');
         }
     } else {
         if ($this->auth->user()->doctor) {
             $queue = Queue::all();
             $patient = Patient::all();
             return view('doctor.dashboard')->with('queue', $queue)->with('patient', $patient);
         } else {
             if ($this->auth->user()->admin) {
                 $queue = Queue::all();
                 $patient = Patient::all();
                 return view('doctor.dashboard')->with('queue', $queue)->with('patient', $patient);
             } else {
                 $queue = Queue::all();
                 $patient = Patient::all();
                 return view('staff.dashboard')->with('queue', $queue)->with('patient', $patient);
             }
         }
     }
     return $next($request);
 }
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     //$data['patient'] = patient::all();
     $patient = Patient::all();
     $queue = Queue::all();
     return view('patient.list', ['patient' => $patient])->with('queue', $queue);
 }
Esempio n. 3
0
 public function removeQueue(Request $request)
 {
     $queue = Queue::all();
     $patient = Patient::all();
     //insert delete from queue
     $queue = Queue::find($request->input('pt_id'));
     //$queue->delete();
     return redirect()->action('StaffController@index')->with('queue', $queue)->with('patient', $patient);
     //return view('staff.dashboard');
 }
Esempio n. 4
0
 public function patientdb()
 {
     $queue = Queue::all();
     return view('doctor.patientdb');
 }