public function save(ProductContract $product, array $attributes = [])
    {
        $result = $product->save();

        $details = [];
        foreach ($attributes as $key => $value) {
            if ($value) {
                $details[$key] = compact('value');
            }
        }
        $product->attributes()->sync($details);

        return $result;
    }
public function save(ProductContract $product, array $attributes = [])
    {
        $result = $product->save();

        $details = [];
        foreach ($attributes as $key => $value) {
            if ($value) {
                $details[$key] = compact('value');
            }
        }
        $product->attributes()->sync($details);

        return $result;
    }
public function save ( ProductContract $ product , array $ attributes = [ ] ) { $ result = $ product -> save ( ) ; $ details = [ ] ; foreach ( $ attributes as $ key => $ value ) { if ( $ value ) { $ details [ $ key ] = compact ( 'value' ) ; } } $ product -> attributes ( ) -> sync ( $ details ) ; return $ result ; }
Stores a product.

@param ProductContract $product
@param array $attributes
@return bool
Stores a product .