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