]> BookStack Code Mirror - bookstack/blob - app/Traits/HasCreatorAndUpdater.php
Apply fixes from StyleCI
[bookstack] / app / Traits / HasCreatorAndUpdater.php
1 <?php
2
3 namespace BookStack\Traits;
4
5 use BookStack\Auth\User;
6 use Illuminate\Database\Eloquent\Relations\BelongsTo;
7
8 /**
9  * @property int created_by
10  * @property int updated_by
11  */
12 trait HasCreatorAndUpdater
13 {
14     /**
15      * Relation for the user that created this entity.
16      */
17     public function createdBy(): BelongsTo
18     {
19         return $this->belongsTo(User::class, 'created_by');
20     }
21
22     /**
23      * Relation for the user that updated this entity.
24      */
25     public function updatedBy(): BelongsTo
26     {
27         return $this->belongsTo(User::class, 'updated_by');
28     }
29 }