Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

106
Vistas
Echo value from pivot table via Ajax larvel

I have an issue that I can't solve.

In laravel I use this code to get a value from a pivot table.

@foreach($data->product as $product)
 <p>{{ $product->pivot->name }}</p>
@endforeach

And i thought I could do the same with jquery, ajax but it does not work. How do I do this?

function getTable() {
     $.ajax({
        type: "GET",
        url: "/product/table",
        datatype: "json",
        success: function (response) {
             $('#table').html("");
             $.each(response.data.product, function (key, product){
                 $('#table').append(
            '<p>' + product.pivot.name + '</p>'
         );
       }); 
      }
  }); 
}
over 4 years ago · Santiago Trujillo
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda