1 <?php namespace BookStack\Auth\Permissions;
3 use BookStack\Auth\Role;
6 class RolePermission extends Model
9 * The roles that belong to the permission.
11 public function roles()
13 return $this->belongsToMany(Role::class, 'permission_role', 'permission_id', 'role_id');
17 * Get the permission object by name.
21 public static function getByName($name)
23 return static::where('name', '=', $name)->first();