chunk() method
breaks the collection into multiple, smaller collections of a given size :data.chunk(x)
Example :
const collect = require('collect.js');
const collection = collect([1, 2, 3, 4, 5, 6, 7]);
const x = collection.chunk(5);
console.log(x.all());
Output :
[ Collection { items: [ 1, 2, 3, 4, 5 ] },
Collection { items: [ 6, 7 ] } ]