public function update(array $attributes, $idOrModel, array $options = [])
    {
    	$product = $this->modelOrFind($idOrModel);
    	$attributes = Collection::make($attributes);

    	$attr = $attributes->except('features', 'pictures', 'default_picture')->merge([
            'features' => \Antvel\Features\Parser::toJson($attributes->get('features')),
            'category_id' => $attributes->get('category'),
            'price' => $attributes->get('price') * 100,
            'cost' => $attributes->get('cost') * 100,
            'status' => $attributes->get('status'),
            'updated_by' => auth()->user()->id,
            'tags' => $attributes->get('name'),
        ])->all();

    	$this->updatePicturesFor($product, $attributes);

    	return $product->update($attr);
    }
public function update(array $attributes, $idOrModel, array $options = [])
    {
    	$product = $this->modelOrFind($idOrModel);
    	$attributes = Collection::make($attributes);

    	$attr = $attributes->except('features', 'pictures', 'default_picture')->merge([
            'features' => \Antvel\Features\Parser::toJson($attributes->get('features')),
            'category_id' => $attributes->get('category'),
            'price' => $attributes->get('price') * 100,
            'cost' => $attributes->get('cost') * 100,
            'status' => $attributes->get('status'),
            'updated_by' => auth()->user()->id,
            'tags' => $attributes->get('name'),
        ])->all();

    	$this->updatePicturesFor($product, $attributes);

    	return $product->update($attr);
    }
public function update ( array $ attributes , $ idOrModel , array $ options = [ ] ) { $ product = $ this -> modelOrFind ( $ idOrModel ) ; $ attributes = Collection :: make ( $ attributes ) ; $ attr = $ attributes -> except ( 'features' , 'pictures' , 'default_picture' ) -> merge ( [ 'features' => \ Antvel \ Features \ Parser :: toJson ( $ attributes -> get ( 'features' ) ) , 'category_id' => $ attributes -> get ( 'category' ) , 'price' => $ attributes -> get ( 'price' ) * 100 , 'cost' => $ attributes -> get ( 'cost' ) * 100 , 'status' => $ attributes -> get ( 'status' ) , 'updated_by' => auth ( ) -> user ( ) -> id , 'tags' => $ attributes -> get ( 'name' ) , ] ) -> all ( ) ; $ this -> updatePicturesFor ( $ product , $ attributes ) ; return $ product -> update ( $ attr ) ; }
Update a Model in the database.

@param array $attributes
@param Product|mixed $idOrModel
@param array $options

@return bool
Update a Model in the database .