livewire-powergrid icon indicating copy to clipboard operation
livewire-powergrid copied to clipboard

Collection Datasource Throws an Unkown Error

Open BenOussama180 opened this issue 3 years ago • 9 comments

This is my datasource : collection_datasource The table shows up normally, but after fiiltering or doing an action that refresh the table, it shows this error : First iit shows a blank livewire error page : image And in the console this : livewire.js?id=c69d0f2801c01fcf8166:13 POST https://linkpandas.com/livewire/message/customer-links-table 500 iit throws a 500 error message, but i dont know whats the error, this bug only occurs on datasource collection, on builer it works normally , i have powergrid V3

BenOussama180 avatar Jun 05 '22 22:06 BenOussama180

any help? :/

BenOussama180 avatar Jun 06 '22 18:06 BenOussama180

I have no idea yet, why not use builder instead of collection?

luanfreitasdev avatar Jun 06 '22 18:06 luanfreitasdev

basically i want to eliminate links duplicates by site , and only showing the cheapest one from the duplicates ( lowest price ) i figured that query out with map, but when i use map on return type of Builder it throws an error u got any idea on how to get same results with Builder ? thank you @luanfreitasdev

BenOussama180 avatar Jun 06 '22 18:06 BenOussama180

Does this map work if you manipulate the Helpers/Model or in the component?

luanfreitasdev avatar Jun 06 '22 18:06 luanfreitasdev

the map works if return type of Datasource is collection, but it throws an error while filtering, if i switch it to Builder i get this -> datasource : image Error : image

BenOussama180 avatar Jun 06 '22 18:06 BenOussama180

any idea on how to get same results ( retreiving only cheapest link by site from duplicates ) with Eloquent\Builder::class ? @luanfreitasdev Thank you for the help

BenOussama180 avatar Jun 06 '22 18:06 BenOussama180

Have you tried using Join ?

luanfreitasdev avatar Jun 06 '22 20:06 luanfreitasdev

No i didnt because i simply couldnt figure it out with join

BenOussama180 avatar Jun 06 '22 22:06 BenOussama180

and i dont need to join two tables there, everything i need is in the same table and Model Links

BenOussama180 avatar Jun 06 '22 22:06 BenOussama180

I believe it is not a bug in the component. Maybe it could be a new feature or something query builder related.

luanfreitasdev avatar Dec 24 '22 01:12 luanfreitasdev