MedicOneSystems / livewire-datatables

Advanced datatables using Laravel, Livewire, Tailwind CSS and Alpine JS
https://livewire-datatables.com/
MIT License
1.19k stars 258 forks source link

Exportable not loading relationships #444

Open richardalain83 opened 2 years ago

richardalain83 commented 2 years ago

Hi, i'm using the exportable property but if my model has relationships, when I click on the Export button, I receive an SQL error, column not found and after investigating, i've found that my relationships are not loaded by a left join.. How can I load my relationships within the exportable?

Thanks

I'm using v 0.8.0

underdpt commented 2 years ago

I can confirm this also happens with 0.9.4

nathcast commented 2 years ago

I also have that problem: have you had a solution? ALso I have found that when I have a relasionship in a table, the hide/unhie columns is not working. I am using sqlsrv Thanks for any pointers.

nileshd commented 1 year ago

This also happens in 0.10.1

The relationships without explicit joins works fine in the display using eloquent relationships.

It only breaks when it tries to build the query for export - the query it builds has the joined column names e.g table2.fieldname but it is selecting only from table1

If I add the left joins in builder, then it works fine.

Would be great to just be able to export using the same builder without explicit left joins