4 months ago

Dashboard view: using filters on collection

Posted 4 months ago by WVA


I'm creating a dashboard for which I use eager loading. For each team I eager load the events. In my dashboard I'm interested in having the whole list of events, but I also want to select the next upcoming event for each event.type.

Where should I define the filter for the collection? I used to define several functions on my Team model, however this resulted in eager loading and executing a lot of queries while I already retrieved all the Events for that team.

Please sign in or create an account to participate in this conversation.