diff --git a/app/Presenters/AssetPresenter.php b/app/Presenters/AssetPresenter.php index 1f71f7de33..236003f614 100644 --- a/app/Presenters/AssetPresenter.php +++ b/app/Presenters/AssetPresenter.php @@ -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