How can I add a custom select when using a filter?

I have a filter where the user selects an address. I then sort by closest location, but I can't seem to get the distance to display. When I do this:
$query->addSelect(ST::distanceSphere($coordinates, 'coordinates')->as('distance_to_address'));
$query->addSelect(ST::distanceSphere($coordinates, 'coordinates')->as('distance_to_address'));
It doesn't actually update the query, it still just has "select *" instead of my added select. The query scope I use does work when I use it outside of filament, it just seems like filament is overwriting the custom select.
0 Replies
No replies yetBe the first to reply to this messageJoin

Did you find this page helpful?