Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

151
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!