/** * Execute the command. * * @param ProductTypeRepository $types * @return ProductType */ public function handle(ProductTypeRepository $types) { $type = $types->findById($this->id)->fill($this->getProperties()); $types->save($type); $type->attributes()->sync($this->attributes); return $type; }
/** * Execute the command. * * @param ProductTypeRepository $types * @return ProductType */ public function handle(ProductTypeRepository $types) { $type = ProductType::register($this->description); $types->save($type); return $type; }