src/Traits/WorksWithFileUploads.php
protected function handleNonMultipleFileUploads(Model $model, $paramName, $uploadedFile, $relativePath)
    {
        if (!$uploadedFile->isValid()) {
            throw new UploadException($uploadedFile->getError());
        }

        $filename = $this->getFilename($uploadedFile);
        $destination = $this->getStoragePath($relativePath);
        $this->moveUploadedFile($uploadedFile, $filename, $destination);

        $location = $relativePath.$filename;

        $model->{$paramName} = $location;
        $model->save();
    }
protected function handleNonMultipleFileUploads(Model $model, $paramName, $uploadedFile, $relativePath)
    {
        if (!$uploadedFile->isValid()) {
            throw new UploadException($uploadedFile->getError());
        }

        $filename = $this->getFilename($uploadedFile);
        $destination = $this->getStoragePath($relativePath);
        $this->moveUploadedFile($uploadedFile, $filename, $destination);

        $location = $relativePath.$filename;

        $model->{$paramName} = $location;
        $model->save();
    }
protected function handleNonMultipleFileUploads ( Model $ model , $ paramName , $ uploadedFile , $ relativePath ) { if ( ! $ uploadedFile -> isValid ( ) ) { throw new UploadException ( $ uploadedFile -> getError ( ) ) ; } $ filename = $ this -> getFilename ( $ uploadedFile ) ; $ destination = $ this -> getStoragePath ( $ relativePath ) ; $ this -> moveUploadedFile ( $ uploadedFile , $ filename , $ destination ) ; $ location = $ relativePath . $ filename ; $ model -> { $ paramName } = $ location ; $ model -> save ( ) ; }
Handle non-multiple file uploads.

@param Model        $model        The eloquent model.
@param string       $paramName    The name of the file param.
@param UploadedFile $uploadedFile The UploadedFile object.
@param string       $relativePath The file uploads relative path.

@return void
Handle non - multiple file uploads .