app/Http/Controllers/UserController.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)
    {
        $q = $request->input('search');
        $user = User::select('users.id', 'nombre_usuario', 'nombre', 'ap_paterno', 'ap_materno', 'email', 'pass', 'estado', 'rol')->where( 'nombre_usuario', 'LIKE', '%' . $q . '%' )->orWhere('nombre', 'LIKE', '%' . $q . '%')->orderBy('users.id', 'desc')->paginate (10)->setPath ( '' );
            $pagination = $user->appends ( array (
                'search' => $request->input('search')
                ) );
        return $user;
    }
public function index ( Request $ request ) { $ q = $ request -> input ( 'search' ) ; $ user = User :: select ( 'users.id' , 'nombre_usuario' , 'nombre' , 'ap_paterno' , 'ap_materno' , 'email' , 'pass' , 'estado' , 'rol' ) -> where ( 'nombre_usuario' , 'LIKE' , '%' . $ q . '%' ) -> orWhere ( 'nombre' , 'LIKE' , '%' . $ q . '%' ) -> orderBy ( 'users.id' , 'desc' ) -> paginate ( 10 ) -> setPath ( '' ) ; $ pagination = $ user -> appends ( array ( 'search' => $ request -> input ( 'search' ) ) ) ; return $ user ; }
Display a listing of the resource.
Display a listing of the resource .
//return User::all();