1 <?php namespace BookStack;
3 class RolePermission extends Model
6 * The roles that belong to the permission.
8 public function roles()
10 return $this->belongsToMany(Role::class, 'permission_role', 'permission_id', 'role_id');
14 * Get the permission object by name.
18 public static function getByName($name)
20 return static::where('name', '=', $name)->first();