Noob question: Sorting a hasMany column in table
I'm really struggle sorry and I am sure it is dead easy to do.
Apologies, I know I've asked a bunch of relation questions, but that seems to be where stuff explodes for me.
What I am trying to do:
I need the HIndex column in the Activities table to be sortable based on the related HIndex with the highest year value (or based on the formatted state would be even better)
Model Activity:
- has many HIndex via
Model HIndex :
- Belongs to one Activity
- Has the columns
-- year
-- value
-- activity_id
In the Activity resource I have:
But it throws:
SQLSTATE[21000]: Cardinality violation: 1242 Subquery returns more than 1 row
1 Reply
I've tried
and
It displays right but when I try to sort it it just throws