]> BookStack Code Mirror - bookstack/blob - app/RolePermission.php
Added Italian language
[bookstack] / app / RolePermission.php
1 <?php namespace BookStack;
2
3
4 class RolePermission extends Model
5 {
6     /**
7      * The roles that belong to the permission.
8      */
9     public function roles()
10     {
11         return $this->belongsToMany(Role::class, 'permission_role','permission_id', 'role_id');
12     }
13
14     /**
15      * Get the permission object by name.
16      * @param $name
17      * @return mixed
18      */
19     public static function getByName($name)
20     {
21         return static::where('name', '=', $name)->first();
22     }
23 }
Morty Proxy This is a proxified and sanitized view of the page, visit original site.