protected function generateSequenceName(UploadedFile $file)
    {
        $index = 1;
        $extension = $file->getClientOriginalExtension();
        $originalName = $file->getClientOriginalName();
        $newName = $originalName.'_'.$index.'.'.$extension;

        while ($this->storage->exists("{$this->getDirectory()}/$newName")) {
            $index++;
            $newName = $originalName.'_'.$index.'.'.$extension;
        }

        return $newName;
    }
protected function generateSequenceName(UploadedFile $file)
    {
        $index = 1;
        $extension = $file->getClientOriginalExtension();
        $originalName = $file->getClientOriginalName();
        $newName = $originalName.'_'.$index.'.'.$extension;

        while ($this->storage->exists("{$this->getDirectory()}/$newName")) {
            $index++;
            $newName = $originalName.'_'.$index.'.'.$extension;
        }

        return $newName;
    }
protected function generateSequenceName ( UploadedFile $ file ) { $ index = 1 ; $ extension = $ file -> getClientOriginalExtension ( ) ; $ originalName = $ file -> getClientOriginalName ( ) ; $ newName = $ originalName . '_' . $ index . '.' . $ extension ; while ( $ this -> storage -> exists ( "{$this->getDirectory()}/$newName" ) ) { $ index ++ ; $ newName = $ originalName . '_' . $ index . '.' . $ extension ; } return $ newName ; }
Generate a sequence name for uploaded file.

@param UploadedFile $file

@return string
Generate a sequence name for uploaded file .