/** * Display a listing of the resource. * * @return Response */ public function index() { $levels = Level::paginate(10); if ($levels->count() === 0) { Session::flash('errorMessage', 'There were no results matching your search.'); } return View::make('/games/levels.index')->with('levels', $levels); }
public function list_levels() { if (Auth::check()) { $data["inside_url"] = Config::get('app.inside_url'); $data["user"] = Session::get('user'); $data["actions"] = Session::get('actions'); if (in_array('side_listar_niveles', $data["actions"])) { $data["search"] = null; $data["levels_data"] = Level::paginate(10); return View::make('levels/list_levels', $data); } else { // Llamo a la función para registrar el log de auditoria $log_description = "Se intentó acceder a la ruta '" . Request::path() . "' por el método '" . Request::method() . "'"; Helpers::registerLog(10, $log_description); Session::flash('error', 'Usted no tiene permisos para realizar dicha acción.'); return Redirect::to('/dashboard'); } } else { return View::make('error/error'); } }