5 use Illuminate\Database\Eloquent\Model;
7 class Role extends Model
10 * The roles that belong to the role.
12 public function users()
14 return $this->belongsToMany('Oxbow\User');
18 * The permissions that belong to the role.
20 public function permissions()
22 return $this->belongsToMany('Oxbow\Permission');
26 * Add a permission to this role.
27 * @param Permission $permission
29 public function attachPermission(Permission $permission)
31 $this->permissions()->attach($permission->id);