RelationshipManager Table Ordering
Is there a method I am missing, to allow sorting the table by an order of a relationships relationship?
For example, we have a resource showing a list of rows, which then shows data from a relationship, then shows more data from that relationships relationship and I want to order by the order column in the end relaitonship so:
Items -> Sub Item -> sub data.order
Solution:Jump to solution
You can inject the query in
->defaultSort()
though π€
```php
->defaultSort(function (Builder $query) {
// ...4 Replies
IIRC
->defaultSort('realtion.anotherRelation')
will not work, but what about ->modifyQueryUsing()
and return data based on sort order provided (didn't check, don't know whether it should work or not tho π )Solution
You can inject the query in
->defaultSort()
though π€
Oh, now i remember that it accept closure as well.. then may achieve using like this
ahhh legend!