3 namespace BookStack\Traits;
5 use BookStack\Auth\User;
6 use Illuminate\Database\Eloquent\Relations\BelongsTo;
9 * @property int created_by
10 * @property int updated_by
12 trait HasCreatorAndUpdater
15 * Relation for the user that created this entity.
17 public function createdBy(): BelongsTo
19 return $this->belongsTo(User::class, 'created_by');
23 * Relation for the user that updated this entity.
25 public function updatedBy(): BelongsTo
27 return $this->belongsTo(User::class, 'updated_by');