Povilas Korop explains how to use a raw groupBy in Laravel. Cool!

https://laraveldaily.com/eloquent-trick-group-by-raw-with-boolean-condition/