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