Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Column entries results duplicated #181

Open
akizor opened this issue Dec 10, 2014 · 2 comments
Open

Column entries results duplicated #181

akizor opened this issue Dec 10, 2014 · 2 comments
Labels

Comments

@akizor
Copy link

akizor commented Dec 10, 2014

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?

@akizor
Copy link
Author

akizor commented Dec 10, 2014

Using ->make(true) it returned:

{

    "0": "1",
    "1": "akizor",
    "2": "1",
    "id": "1",
    "username": "akizor",
    "confirmed": "1"

},

@akizor
Copy link
Author

akizor commented Dec 10, 2014

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants