Added imageSrc presenter to assets

This commit is contained in:
snipe 2017-11-02 04:15:24 -07:00
parent 41452450b3
commit ba9bb470eb

View file

@ -280,6 +280,26 @@ class AssetPresenter extends Presenter
return $imagePath;
}
/**
* Generate img tag to this items image.
* @return mixed|string
*/
public function imageSrc()
{
$imagePath = '';
if ($this->image && !empty($this->image)) {
$imagePath = $this->image;
return 'poop';
} elseif ($this->model && !empty($this->model->image)) {
$imagePath = $this->model->image;
return 'fart';
}
if (!empty($imagePath)) {
return config('app.url').'/uploads/assets/'.$imagePath;
}
return $imagePath;
}
/**
* Get Displayable Name
* @return string