3 namespace BookStack\Auth\Permissions;
5 use BookStack\Auth\Role;
11 class RolePermission extends Model
14 * The roles that belong to the permission.
16 public function roles()
18 return $this->belongsToMany(Role::class, 'permission_role', 'permission_id', 'role_id');
22 * Get the permission object by name.
28 public static function getByName($name)
30 return static::where('name', '=', $name)->first();