public function renameFile($modelId, UploadedFile $uploadedFile)
    {
        $extension = $uploadedFile->getClientOriginalExtension();
        if (!empty($extension)) {
            $extension = '.' . strtolower($extension);
        }
        $fileName = $this->sanitizeFileName(
            str_replace(
                $extension,
                '',
                $uploadedFile->getClientOriginalName()
            ) . '-' . $modelId . $extension
        );

        return $fileName;
    }
public function renameFile($modelId, UploadedFile $uploadedFile)
    {
        $extension = $uploadedFile->getClientOriginalExtension();
        if (!empty($extension)) {
            $extension = '.' . strtolower($extension);
        }
        $fileName = $this->sanitizeFileName(
            str_replace(
                $extension,
                '',
                $uploadedFile->getClientOriginalName()
            ) . '-' . $modelId . $extension
        );

        return $fileName;
    }
public function renameFile ( $ modelId , UploadedFile $ uploadedFile ) { $ extension = $ uploadedFile -> getClientOriginalExtension ( ) ; if ( ! empty ( $ extension ) ) { $ extension = '.' . strtolower ( $ extension ) ; } $ fileName = $ this -> sanitizeFileName ( str_replace ( $ extension , '' , $ uploadedFile -> getClientOriginalName ( ) ) . '-' . $ modelId . $ extension ) ; return $ fileName ; }
Rename file with image model id

@param int          $modelId      Model id
@param UploadedFile $uploadedFile File being saved

@return string
Rename file with image model id