what is best practice when you need to calculate custom collections in child model?
I have 2 Models-
Refill, Car has many Refills. I want to calculate average fuel consumption by month which basically creates new collection from refills entries, currently I have static class within Refill model that accepts car id as parameter, then does select query and iterates through results.
Is it possible to do something like
$car->refills()->getAverageMpgByMonth() instead of