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