BookStack/app/Image.php
Dan Brown d5b922aa50
Started work on drawing revisions
Improved sidebar and selection styling of image manager.
Allowed image manager imageType to be changed on open.
Created models for image revisions.
2018-05-13 12:07:38 +01:00

31 lines
672 B
PHP

<?php namespace BookStack;
use Images;
class Image extends Ownable
{
protected $fillable = ['name'];
/**
* Get a thumbnail for this image.
* @param int $width
* @param int $height
* @param bool|false $keepRatio
* @return string
* @throws \Exception
*/
public function getThumb($width, $height, $keepRatio = false)
{
return Images::getThumbnail($this, $width, $height, $keepRatio);
}
/**
* Get the revisions for this image.
* @return \Illuminate\Database\Eloquent\Relations\HasMany
*/
public function revisions()
{
return $this->hasMany(ImageRevision::class);
}
}