public function collectionGroup($property)
    {
        $collections = [];
        foreach ($this->group($property) as $id => $elements) {
            $collection = $this->createFrom($elements);

            $collections[$id] = $collection;
        }

        return $collections;
    }
public function collectionGroup($property)
    {
        $collections = [];
        foreach ($this->group($property) as $id => $elements) {
            $collection = $this->createFrom($elements);

            $collections[$id] = $collection;
        }

        return $collections;
    }
public function collectionGroup ( $ property ) { $ collections = [ ] ; foreach ( $ this -> group ( $ property ) as $ id => $ elements ) { $ collection = $ this -> createFrom ( $ elements ) ; $ collections [ $ id ] = $ collection ; } return $ collections ; }
Group items in the collection by a field and return them as associated array of collections.

@param string $property
@return static[]
Group items in the collection by a field and return them as associated array of collections .