X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/db3acabc662e976f253db47f82162c9f00667446..refs/pull/438/head:/app/Ownable.php diff --git a/app/Ownable.php b/app/Ownable.php index d6505b746..f2cfe801b 100644 --- a/app/Ownable.php +++ b/app/Ownable.php @@ -1,7 +1,7 @@ belongsTo('BookStack\User', 'created_by'); + return $this->belongsTo(User::class, 'created_by'); } /** @@ -18,6 +18,16 @@ trait Ownable */ public function updatedBy() { - return $this->belongsTo('BookStack\User', 'updated_by'); + return $this->belongsTo(User::class, 'updated_by'); } + + /** + * Gets the class name. + * @return string + */ + public static function getClassName() + { + return strtolower(array_slice(explode('\\', static::class), -1, 1)[0]); + } + } \ No newline at end of file