public function postSearch() { $q = Input::get('query'); $seances = Seance::where('name', 'LIKE', '%' . $q . '%')->get(); $title = "Seances: " . count($seances); return View::make('hello', compact('seances', 'title')); }
public function home() { if (Auth::guest()) { return Redirect::to('/login'); } //appel des composants en base $nb_patients_total = Patient::all()->count(); $nb_seances_total = Seance::all()->count(); $nb_patients_semaine = Patient::where('created_at', '>=', time() - 7 * 24 * 60 * 60)->count(); $nb_seances_semaine = Seance::where('date', '>=', time() - 7 * 24 * 60 * 60)->count(); //retour de la vue return View::make('backend.home', compact('nb_patients_total', 'nb_seances_total', 'nb_patients_semaine', 'nb_seances_semaine')); }