/** * Handle the command. * * @param UpdateProduct $command * @return void */ public function handle(UpdateProduct $command) { $this->productRepository->update($command->productId, $command->input); $modelNumber = $this->productRepository->findLastSavedModelNumber(); $imageCount = $this->imageRepository->count() + 1; $this->imageRepository->uploadImages($command->input['images'], $modelNumber, $command->productId, $imageCount); }