public function groupWith(...$products)
    {
        $products = Collection::make($products)->flatten()->all();

        foreach ($products as $product) {
            if (! $this->hasGroup($product)) {
                $this->group()->attach($product);
            }
        }
    }
public function groupWith(...$products)
    {
        $products = Collection::make($products)->flatten()->all();

        foreach ($products as $product) {
            if (! $this->hasGroup($product)) {
                $this->group()->attach($product);
            }
        }
    }
public function groupWith ( ... $ products ) { $ products = Collection :: make ( $ products ) -> flatten ( ) -> all ( ) ; foreach ( $ products as $ product ) { if ( ! $ this -> hasGroup ( $ product ) ) { $ this -> group ( ) -> attach ( $ product ) ; } } }
Add products to a given group.

@param  array $products

@return void
Add products to a given group .