laravel4-datatables-package
laravel4-datatables-package copied to clipboard
Column entries results duplicated
Greetings,
I'm encountering an issue with Datatables. No mater what columns I select, the output in aaData block is duplicated for each element. Code used:
$users = User::select('users.id', 'users.username', 'users.confirmed');
return Datatables::of($users)
->make();
Output:
[
"1",
"1",
"akizor",
"akizor",
"1",
"1"
],
How can i solve this?
Using ->make(true) it returned:
{
"0": "1",
"1": "akizor",
"2": "1",
"id": "1",
"username": "akizor",
"confirmed": "1"
},
This can be solved by using columns attribute in javascript Datatables and using ->make(true) when generating json for it. But still looking for solution for the first post.