app/Http/Controllers/seguridad/PermisosController.php
/**
     * Display a listing of the resource.
     *
     * @return \Illuminate\Http\Response
     */
Display a listing of the resource.
@return \Illuminate\Http\Response
Display a listing of the resource . @return \ Illuminate \ Http \ Response
public function index(Request $request)
    {
        $keyword = $request->get('search');
        $perPage = 25;
        if (!empty($keyword)) {
          $permisos = Permission::where('name', 'LIKE', "%$keyword%")
            ->orWhere('guard_name', 'LIKE', "%$keyword%")
            ->latest()->paginate($perPage);
        } else {
          $permisos = Permission::orderBy('id','DESC')->latest()->paginate($perPage);
        }
        $esabm = true;
        return view('seguridad.permisos.index',compact('permisos','esabm'))
            ->with('i', ($request->input('page', 1) - 1) * 5);
    }
public function index ( Request $ request ) { $ keyword = $ request -> get ( 'search' ) ; $ perPage = 25 ; if ( ! empty ( $ keyword ) ) { $ permisos = Permission :: where ( 'name' , 'LIKE' , " % $ keyword % " ) -> orWhere ( 'guard_name' , 'LIKE' , " % $ keyword % " ) -> latest ( ) -> paginate ( $ perPage ) ; } else { $ permisos = Permission :: orderBy ( 'id' , 'DESC' ) -> latest ( ) -> paginate ( $ perPage ) ; } $ esabm = true ; return view ( 'seguridad.permisos.index' , compact ( 'permisos' , 'esabm' ) ) -> with ( 'i' , ( $ request -> input ( 'page' , 1 ) - 1 ) * 5 ) ; }
Display a listing of the resource.
Display a listing of the resource .