/** * Display a listing of the resource. * * @return Response */ public function index(Request $request) { $buscar = $request->input('buscar'); $nivel = \App\UserLevel::where('UserLevelName', 'LIKE', '%' . $buscar . '%')->paginate(5); $nivel->setPath('niveles'); return view('niveles.index')->with('nivel', $nivel); }