public function getPhoto($attributes = [], $type='original', $onlyUrl = false, $modelSlug = null, $relation = null)
    {
        $this->setAttributes($modelSlug,'photo');
        $photo = $this->getFile();

        if( ! is_null($photo)) {
            $src = $this->getFileSrc($photo, $relation, $type);
        } else {
            $type = $type === 'original' ? 'biggest' : $type;
            $src = config("{$this->module}.{$this->modelSlug}.default_img_path") . "/{$type}.jpg";
        }

        $attr = $this->getHTMLAttributes($attributes);
        return $onlyUrl ? asset($src) : '<img src="'.asset($src).'" '.$attr.'>';
    }
public function getPhoto($attributes = [], $type='original', $onlyUrl = false, $modelSlug = null, $relation = null)
    {
        $this->setAttributes($modelSlug,'photo');
        $photo = $this->getFile();

        if( ! is_null($photo)) {
            $src = $this->getFileSrc($photo, $relation, $type);
        } else {
            $type = $type === 'original' ? 'biggest' : $type;
            $src = config("{$this->module}.{$this->modelSlug}.default_img_path") . "/{$type}.jpg";
        }

        $attr = $this->getHTMLAttributes($attributes);
        return $onlyUrl ? asset($src) : '<img src="'.asset($src).'" '.$attr.'>';
    }
public function getPhoto ( $ attributes = [ ] , $ type = 'original' , $ onlyUrl = false , $ modelSlug = null , $ relation = null ) { $ this -> setAttributes ( $ modelSlug , 'photo' ) ; $ photo = $ this -> getFile ( ) ; if ( ! is_null ( $ photo ) ) { $ src = $ this -> getFileSrc ( $ photo , $ relation , $ type ) ; } else { $ type = $ type === 'original' ? 'biggest' : $ type ; $ src = config ( "{$this->module}.{$this->modelSlug}.default_img_path" ) . "/{$type}.jpg" ; } $ attr = $ this -> getHTMLAttributes ( $ attributes ) ; return $ onlyUrl ? asset ( $ src ) : '<img src="' . asset ( $ src ) . '" ' . $ attr . '>' ; }
get the html photo element

@param array $attributes
@param string $type  original or thumbnails key
@param boolean $onlyUrl
@param string|null $modelSlug
@param string|null $relation
@return string
get the html photo element