예제 #1
0
 /**
  * Display a listing of the resource.
  * Called loadPatients because the same controller shall be used for all other reports
  * @return Response
  */
 public function loadPatients()
 {
     $search = Input::get('search');
     $patients = Patient::search($search)->orderBy('id', 'DESC')->paginate(Config::get('kblis.page-items'));
     if (count($patients) == 0) {
         Session::flash('message', trans('messages.no-match'));
     }
     // Load the view and pass the patients
     return view('reports.patient.index')->with('patients', $patients)->withInput(Input::all());
 }
예제 #2
0
 /**
  * Return a Patients collection that meets the searched criteria as JSON.
  *
  * @return Response
  */
 public function search()
 {
     return Patient::search(Input::get('text'))->take(config('blis.limit-items'))->get()->toJson();
 }