Okipa / laravel-table

Generate tables from Eloquent models.
MIT License
546 stars 65 forks source link

pass a ready model to table #22

Closed afkhami7e closed 5 years ago

afkhami7e commented 5 years ago

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...

Okipa commented 5 years ago

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.

afkhami7e commented 5 years ago

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...

Okipa commented 5 years ago

Ok, I close the issue as you seem to have found a way to make this work.
Happy coding !