1 <?php namespace BookStack;
4 class RolePermission extends Model
7 * The roles that belong to the permission.
9 public function roles()
11 return $this->belongsToMany(Role::class, 'permission_role','permission_id', 'role_id');
15 * Get the permission object by name.
19 public static function getByName($name)
21 return static::where('name', '=', $name)->first();