]> BookStack Code Mirror - bookstack/blob - app/Ownable.php
Update errors.php
[bookstack] / app / Ownable.php
1 <?php namespace BookStack;
2
3 use BookStack\Auth\User;
4
5 abstract class Ownable extends Model
6 {
7     /**
8      * Relation for the user that created this entity.
9      * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
10      */
11     public function createdBy()
12     {
13         return $this->belongsTo(User::class, 'created_by');
14     }
15
16     /**
17      * Relation for the user that updated this entity.
18      * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
19      */
20     public function updatedBy()
21     {
22         return $this->belongsTo(User::class, 'updated_by');
23     }
24
25     /**
26      * Gets the class name.
27      * @return string
28      */
29     public static function getClassName()
30     {
31         return strtolower(array_slice(explode('\\', static::class), -1, 1)[0]);
32     }
33 }
Morty Proxy This is a proxified and sanitized view of the page, visit original site.