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

149
Vistas
datatables javascript list with laravel

i am trying to transfer data from laravel to datatables. but in no way is the incoming data datatables loaded. where is the mistake? Laravel function and javascript are specified below. I have stated the result of the incoming data console below.

public function getTag()
    {
        $tag = Tag::all();
        $data['data'] = $tag;
        return $data;
}
async created() {
        const res = await this.callApi('get', 'app/get_tags')
        if (res.status === 200) {
            console.log(res.data);
            $("#datatables").DataTable({
                data: res.data,
                columns: [
                    {
                        data: "tagName",
                    },
                ]
            });
        } else {
            console.log("error database");
        }
    }
{
    "data": [
        {
            "id": 1,
            "tagName": "asdasdasd",
            "created_at": "2021-08-14T13:44:00.000000Z",
            "updated_at": "2021-08-14T13:44:00.000000Z"
        },
        {
            "id": 2,
            "tagName": "asdasd",
            "created_at": "2021-08-14T13:45:03.000000Z",
            "updated_at": "2021-08-14T13:45:03.000000Z"
        },
        {
            "id": 3,
            "tagName": "asdasd23",
            "created_at": "2021-08-14T13:45:26.000000Z",
            "updated_at": "2021-08-14T13:45:26.000000Z"
        },
        {
            "id": 4,
            "tagName": "asdasd23231",
            "created_at": "2021-08-14T13:46:17.000000Z",
            "updated_at": "2021-08-14T13:46:17.000000Z"
        }
    ]
}
about 4 years ago · Juan Pablo Isaza
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