1 <?php namespace BookStack;
3 use Illuminate\Database\Eloquent\Model;
5 class PageRevision extends Model
7 protected $fillable = ['name', 'html', 'text', 'markdown'];
10 * Get the user that created the page revision
11 * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
13 public function createdBy()
15 return $this->belongsTo('BookStack\User', 'created_by');
19 * Get the page this revision originates from.
20 * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
22 public function page()
24 return $this->belongsTo('BookStack\Page');
28 * Get the url for this revision.
31 public function getUrl()
33 return $this->page->getUrl() . '/revisions/' . $this->id;