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