public function merge(Region $region, $homogenize = true)
    {
        if ($region->name() !== $this->name()) {
            $blocks1 = $this->blocks();
            $blocks2 = $region->blocks();
            $combined = $blocks1->append($blocks2)->toArray(false);
            $this->blocks(collection($combined));

            if ($homogenize) {
                $this->homogenize();
            }
        }

        return $this;
    }
public function merge(Region $region, $homogenize = true)
    {
        if ($region->name() !== $this->name()) {
            $blocks1 = $this->blocks();
            $blocks2 = $region->blocks();
            $combined = $blocks1->append($blocks2)->toArray(false);
            $this->blocks(collection($combined));

            if ($homogenize) {
                $this->homogenize();
            }
        }

        return $this;
    }
public function merge ( Region $ region , $ homogenize = true ) { if ( $ region -> name ( ) !== $ this -> name ( ) ) { $ blocks1 = $ this -> blocks ( ) ; $ blocks2 = $ region -> blocks ( ) ; $ combined = $ blocks1 -> append ( $ blocks2 ) -> toArray ( false ) ; $ this -> blocks ( collection ( $ combined ) ) ; if ( $ homogenize ) { $ this -> homogenize ( ) ; } } return $ this ; }
Merge blocks from another region.

You can not merge regions with the same machine-name, new blocks are appended
to this region.

@param \Block\View\Region $region Region to merge with
@param bool $homogenize Set to true to make sure all blocks in the
collection are marked as they belongs to this region
@return \Block\View\Region This region with $region's blocks appended
Merge blocks from another region .