]> BookStack Code Mirror - bookstack/blob - app/Ownable.php
Fixes #45
[bookstack] / app / Ownable.php
1 <?php namespace BookStack;
2
3
4 trait Ownable
5 {
6     /**
7      * Relation for the user that created this entity.
8      * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
9      */
10     public function createdBy()
11     {
12         return $this->belongsTo('BookStack\User', 'created_by');
13     }
14
15     /**
16      * Relation for the user that updated this entity.
17      * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
18      */
19     public function updatedBy()
20     {
21         return $this->belongsTo('BookStack\User', 'updated_by');
22     }
23 }