Is there a way to sort nested relationship?
Closed this issue · 3 comments
piotrbien commented
Hello,
I am trying to sort a nested relationship column:
$order->user->customerGroup->name
I tried defining $sortable arrays in all of the related models, but when I try @sortablelink('user.customerGroup.name')
I'm getting an error Invalid sort argument.
I couldn't find the solution in the docs. What am I missing?
Kyslik commented
You'd have to write your own join for this to work https://github.com/Kyslik/column-sortable#columnsortable-overriding-advanced.
piotrbien commented
Closing, came back to this issue today with a well-slept clear mind and solved it pretty easily. Thanks for your help anyway, great package you have here!
Kyslik commented
Yea that usually helps :) or shower 🚿 .
Enjoy and feel free to contribute.