public function batch($size)
    {
        $chunks = array_chunk($this->items, $size, true);

        $list = [];
        foreach ($chunks as $chunk) {
            $list[] = new static($chunk, $this->params, $this->pages);
        }

        return $list;
    }
public function batch($size)
    {
        $chunks = array_chunk($this->items, $size, true);

        $list = [];
        foreach ($chunks as $chunk) {
            $list[] = new static($chunk, $this->params, $this->pages);
        }

        return $list;
    }
public function batch ( $ size ) { $ chunks = array_chunk ( $ this -> items , $ size , true ) ; $ list = [ ] ; foreach ( $ chunks as $ chunk ) { $ list [ ] = new static ( $ chunk , $ this -> params , $ this -> pages ) ; } return $ list ; }
Split collection into array of smaller collections.

@param int $size
@return array|Collection[]
Split collection into array of smaller collections .