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