]> BookStack Code Mirror - bookstack/blob - app/PageRevision.php
Applied baseUrl to login redirect
[bookstack] / app / PageRevision.php
1 <?php namespace BookStack;
2
3
4 class PageRevision extends Model
5 {
6     protected $fillable = ['name', 'html', 'text', 'markdown', 'summary'];
7
8     /**
9      * Get the user that created the page revision
10      * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
11      */
12     public function createdBy()
13     {
14         return $this->belongsTo(User::class, 'created_by');
15     }
16
17     /**
18      * Get the page this revision originates from.
19      * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
20      */
21     public function page()
22     {
23         return $this->belongsTo(Page::class);
24     }
25
26     /**
27      * Get the url for this revision.
28      * @return string
29      */
30     public function getUrl()
31     {
32         return $this->page->getUrl() . '/revisions/' . $this->id;
33     }
34
35 }