1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-09-09 06:29:32 +03:00
Files
bookstack/app/Users/Models/HasCreatorAndUpdater.php
2025-08-09 11:09:50 +01:00

31 lines
627 B
PHP

<?php
namespace BookStack\Users\Models;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
/**
* @property int $created_by
* @property int $updated_by
* @property ?User $createdBy
* @property ?User $updatedBy
*/
trait HasCreatorAndUpdater
{
/**
* Relation for the user that created this entity.
*/
public function createdBy(): BelongsTo
{
return $this->belongsTo(User::class, 'created_by');
}
/**
* Relation for the user that updated this entity.
*/
public function updatedBy(): BelongsTo
{
return $this->belongsTo(User::class, 'updated_by');
}
}