1 <?php namespace BookStack;
3 use BookStack\Auth\User;
6 * @property int created_by
7 * @property int updated_by
9 abstract class Ownable extends Model
12 * Relation for the user that created this entity.
13 * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
15 public function createdBy()
17 return $this->belongsTo(User::class, 'created_by');
21 * Relation for the user that updated this entity.
22 * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
24 public function updatedBy()
26 return $this->belongsTo(User::class, 'updated_by');
30 * Gets the class name.
33 public static function getClassName()
35 return strtolower(array_slice(explode('\\', static::class), -1, 1)[0]);