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