Back

Sorting by related field


jerauf posted 2 years ago

I’ve got a problem that’s preventing me from finishing a page.

I need to be able to sort by a related field (sort_title in the shows table) but a join is causing preventing eager loading from another relationship.

If I join credits with shows, then I can’t load roles (which credits also relates to in a hasMany relationship) since the relationship is on credits.id and roles.credit_id. If I join shows on credits.show_id = shows.id, id is ambiguous and the relationship with roles won’t work.

Any suggestions would be appreciated.


Sign in to participate in this thread!



We'd like to thank these amazing companies for supporting us