public function renameIfExists(UploadedFile $file)
    {
        if ($this->storage->exists("{$this->getDirectory()}/$this->name")) {
            $this->name = $this->generateUniqueName($file);
        }
    }
public function renameIfExists(UploadedFile $file)
    {
        if ($this->storage->exists("{$this->getDirectory()}/$this->name")) {
            $this->name = $this->generateUniqueName($file);
        }
    }
public function renameIfExists ( UploadedFile $ file ) { if ( $ this -> storage -> exists ( "{$this->getDirectory()}/$this->name" ) ) { $ this -> name = $ this -> generateUniqueName ( $ file ) ; } }
If name already exists, rename it.

@param $file

@return void
If name already exists rename it .