Palzin Track
Get 15% off with code PTRACKSIGNUP15 

Laravel Diary Logo

Laravel Collection Public API: groupBy

The groupBy method is used to group a collection based on a given value. This value can be a string or a callback function. By default, the keys of the collection will not be preserved when grouping, but this can be changed by passing true as the second parameter. The method returns a new instance of the Collection class with...