clearMediaCollection(self::COLLECTION); } public function replace(Customer $customer, string $path, string $fileName): void { $this->clear($customer); $customer->addMedia($path) ->usingFileName($fileName) ->toMediaCollection(self::COLLECTION); } }