1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-07-30 04:23:11 +03:00

Added an image service and facade, Cleaned Image Model

This commit is contained in:
Dan Brown
2015-12-09 19:50:17 +00:00
parent a3188d349c
commit db3acabc66
8 changed files with 268 additions and 183 deletions

View File

@ -3,22 +3,22 @@
namespace BookStack;
class Image extends Entity
use Images;
class Image
{
use Ownable;
protected $fillable = ['name'];
public function getFilePath()
{
return storage_path() . $this->url;
}
/**
* Get the url for this item.
* @return string
* Get a thumbnail for this image.
* @param int $width
* @param int $height
* @param bool|false $hardCrop
*/
public function getUrl()
public function getThumb($width, $height, $hardCrop = false)
{
return public_path() . $this->url;
Images::getThumbnail($this, $width, $height, $hardCrop);
}
}