public function handle(ProductRepository $productRepository, Dispatcher $event)
    {
        $product = $productRepository->find($this->id)->fill(array_except(get_object_vars($this), ['attributes']));

        $productRepository->save($product, $this->attributes);

        $event->fire(new ProductWasUpdated($product));

        return $product;
    }
public function handle(ProductRepository $productRepository, Dispatcher $event)
    {
        $product = $productRepository->find($this->id)->fill(array_except(get_object_vars($this), ['attributes']));

        $productRepository->save($product, $this->attributes);

        $event->fire(new ProductWasUpdated($product));

        return $product;
    }
public function handle ( ProductRepository $ productRepository , Dispatcher $ event ) { $ product = $ productRepository -> find ( $ this -> id ) -> fill ( array_except ( get_object_vars ( $ this ) , [ 'attributes' ] ) ) ; $ productRepository -> save ( $ product , $ this -> attributes ) ; $ event -> fire ( new ProductWasUpdated ( $ product ) ) ; return $ product ; }
Handles updating of the product.

@param ProductRepository $productRepository
@param Dispatcher $event
@return Product
Handles updating of the product .