<?php namespace BookStack\Uploads;
+use BookStack\Entities\Page;
use BookStack\Ownable;
use Images;
{
protected $fillable = ['name'];
+ protected $hidden = [];
/**
* Get a thumbnail for this image.
{
return Images::getThumbnail($this, $width, $height, $keepRatio);
}
+
+ /**
+ * Get the page this image has been uploaded to.
+ * Only applicable to gallery or drawio image types.
+ * @return Page|null
+ */
+ public function getPage()
+ {
+ return $this->belongsTo(Page::class, 'uploaded_to')->first();
+ }
}