1 <?php namespace BookStack;
4 class PageRevision extends Model
6 protected $fillable = ['name', 'html', 'text', 'markdown', 'summary'];
9 * Get the user that created the page revision
10 * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
12 public function createdBy()
14 return $this->belongsTo(User::class, 'created_by');
18 * Get the page this revision originates from.
19 * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
21 public function page()
23 return $this->belongsTo(Page::class);
27 * Get the url for this revision.
30 public function getUrl()
32 return $this->page->getUrl() . '/revisions/' . $this->id;