mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-25 05:34:06 -08:00
Added imageSrc presenter to assets
This commit is contained in:
parent
41452450b3
commit
ba9bb470eb
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue