1 <?php namespace BookStack;
4 abstract class Ownable extends Model
7 * Relation for the user that created this entity.
8 * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
10 public function createdBy()
12 return $this->belongsTo(User::class, 'created_by');
16 * Relation for the user that updated this entity.
17 * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
19 public function updatedBy()
21 return $this->belongsTo(User::class, 'updated_by');
25 * Gets the class name.
28 public static function getClassName()
30 return strtolower(array_slice(explode('\\', static::class), -1, 1)[0]);