Skip to content

Added groupBy method to IndexedCache

Choose a tag to compare

@okdewit okdewit released this 19 Apr 13:14
· 6 commits to main since this release

Example:

$colorcache = new ColorCache();

$collection = new ColorCollection([
    new Color(1, 'green'),
    new Color(2, 'blue'),
    new Color(3, 'blue'),
    new Color(4, 'green')
]);

$colorcache->warm($collection);

$grouped = $colorcache->groupBy('color');

$grouped will be a LazyCollection with Collections of grouped items inside.