pass a ready model to table
afkhami7e opened this issue · 3 comments
Hi
i want pass a model to table without use model() method for example:
(new Table())->model(User::class)
so, i want use like this:
$users = user::all()
(new Table())->model($users)
means i can't use eloquent in laravel-table..
thanks...
Hi @mehdi7e
Sorry for the late reply, I was on vacations !
It is currently not possible to load a table from an already built and/or filtered collection.
This package use eloquent under the hood to build your table from a defined model (User in your case).
What are you trying to achieve here ? I may be able to guide you.
Hi @Okipa
your welcome and thanks your answer
I use phpTrait in my project i can't them in laravel-table because is a external query...
Now, i (force) use query builder...
thanks any way...
Ok, I close the issue as you seem to have found a way to make this work.
Happy coding !