src/Base/ArrayFunctionsTrait.php
public function chunk(int $size, bool $preserve_keys = false): CollectionInterface
    {
        $return = array_chunk($this->toArray(), $size, $preserve_keys);

        return static::make($return);
    }
public function chunk(int $size, bool $preserve_keys = false): CollectionInterface
    {
        $return = array_chunk($this->toArray(), $size, $preserve_keys);

        return static::make($return);
    }
public function chunk ( int $ size , bool $ preserve_keys = false ) : CollectionInterface { $ return = array_chunk ( $ this -> toArray ( ) , $ size , $ preserve_keys ) ; return static :: make ( $ return ) ; }
Splits an array into chunks.

@param int  $size          The size of each chunk.
@param bool $preserve_keys Whether the keys should be preserved.

@return Collection A new collection instance.
Splits an array into chunks .