public function getDocument($attributes = [], $onlyUrl = false, $modelSlug = null, $relation = null)
    {
        $this->setAttributes($modelSlug,'file');
        $file = $this->getFile();

        if (is_null($file)) {
            return '';
        }
        $src = $this->getFileDownloadSrc($file, $relation);
        $attr = $this->getHTMLAttributes($attributes);
        return $onlyUrl ? asset($src) : '<a href="'.asset($src).'" '.$attr.'> ' . $file . '</a>';
    }
public function getDocument($attributes = [], $onlyUrl = false, $modelSlug = null, $relation = null)
    {
        $this->setAttributes($modelSlug,'file');
        $file = $this->getFile();

        if (is_null($file)) {
            return '';
        }
        $src = $this->getFileDownloadSrc($file, $relation);
        $attr = $this->getHTMLAttributes($attributes);
        return $onlyUrl ? asset($src) : '<a href="'.asset($src).'" '.$attr.'> ' . $file . '</a>';
    }
public function getDocument ( $ attributes = [ ] , $ onlyUrl = false , $ modelSlug = null , $ relation = null ) { $ this -> setAttributes ( $ modelSlug , 'file' ) ; $ file = $ this -> getFile ( ) ; if ( is_null ( $ file ) ) { return '' ; } $ src = $ this -> getFileDownloadSrc ( $ file , $ relation ) ; $ attr = $ this -> getHTMLAttributes ( $ attributes ) ; return $ onlyUrl ? asset ( $ src ) : '<a href="' . asset ( $ src ) . '" ' . $ attr . '> ' . $ file . '</a>' ; }
get the html document element

@param array $attributes
@param boolean $onlyUrl
@param string|null $modelSlug
@param string|null $relation
@return string
get the html document element