I have a collection of items as a result of an Eloquent model query. What I need to do is to somehow group the items of that collection either by one column or another depending on a specific item's field value if it satisfies a condition. Is it possible to use a function inside the groupBy()
or there is another way to do this, if possible at all? I'll provide additional details if needed in case there is a theoretical solution for such situation.
via Eseth