Get Data without column names in eloquent.

Posted 1 week ago by gouseferoz

I was trying to get data from db without column names so that i can pass them to the highcharts stocks like here: https://jsfiddle.net/gh/get/library/pure/highcharts/highcharts/tree/master/samples/stock/demo/basic-line/

When i am trying to get data, it is returning something in this format:

[
{
"updated_at": "2019-06-24 17:03:24",
"total": 0
},
{
"updated_at": "2019-06-24 17:39:12",
"total": 2
},
{
"updated_at": "2019-06-24 19:23:50",
"total": 2
},
{
"updated_at": "2019-06-24 19:25:30",
"total": 1
},

How can i get data into this format:

[
[
1499779800000,
145.53
],
[
1499866200000,
145.74
],
[
1499952600000,
147.77
],
[
1500039000000,
149.04
],

Regards, Feroz.

Please sign in or create an account to participate in this conversation.