1 <?php namespace BookStack\Uploads;
3 use BookStack\Entities\Page;
7 class Image extends Ownable
10 protected $fillable = ['name'];
13 * Get a thumbnail for this image.
16 * @param bool|false $keepRatio
20 public function getThumb($width, $height, $keepRatio = false)
22 return Images::getThumbnail($this, $width, $height, $keepRatio);
26 * Get the page this image has been uploaded to.
27 * Only applicable to gallery or drawio image types.
30 public function getPage()
32 return $this->belongsTo(Page::class, 'uploaded_to')->first();