1 <?php namespace BookStack;
5 class Image extends Ownable
8 protected $fillable = ['name'];
11 * Get a thumbnail for this image.
14 * @param bool|false $keepRatio
18 public function getThumb($width, $height, $keepRatio = false)
20 return Images::getThumbnail($this, $width, $height, $keepRatio);
24 * Get the revisions for this image.
25 * @return \Illuminate\Database\Eloquent\Relations\HasMany
27 public function revisions()
29 return $this->hasMany(ImageRevision::class);
33 * Get the count of revisions made to this image.
34 * Based off numbers on revisions rather than raw count of attached revisions
35 * as they may be cleared up or revisions deleted at some point.
38 public function revisionCount()
40 return intval($this->revisions()->max('revision'));