Laravel - Collections - Method Split

The split method breaks a collection into the given number of groups:

    
    $collection = collect([1, 2, 3, 4, 5]);
    
    $groups = $collection->split(3);
    
    $groups->all();
    
    // [[1, 2], [3, 4], [5]]