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

Don't require closures #1

Conversation

mateusjatenee
Copy link
Contributor

I don't think we need to explicitly require closures when adding columns — if one isn't passed, we can infer that it refers to an attribute of the model.

The PR also requires a small refactor and naming changes. Let me know if you want to remove those!

@mateusjatenee
Copy link
Contributor Author

mateusjatenee commented Apr 10, 2021

Another suggestion — right now it always uses the id property to sort the collection. Now, there are two other possibilities: 1) the model's primary key isn't ID and 2) the data doesn't have an ID at all.

Supporting 2 would give this package the ability to generate datatables to anything at all — not only Eloquent models.
Now, this requires further changes and I didn't want to add in this PR. Let me know if you want some help!

@luanfreitasdev luanfreitasdev merged commit f266535 into Power-Components:main Apr 11, 2021
@luanfreitasdev
Copy link
Collaborator

I found the functionality very valid and useful !.

This made the code much cleaner and more usable.

You can send the PR that together we will make a quality datatable

Thanks @mateusjatenee

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

Successfully merging this pull request may close these issues.

2 participants