1 <?php namespace BookStack;
3 abstract class Ownable extends Model
6 * Relation for the user that created this entity.
7 * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
9 public function createdBy()
11 return $this->belongsTo(User::class, 'created_by');
15 * Relation for the user that updated this entity.
16 * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
18 public function updatedBy()
20 return $this->belongsTo(User::class, 'updated_by');
24 * Gets the class name.
27 public static function getClassName()
29 return strtolower(array_slice(explode('\\', static::class), -1, 1)[0]);