What's Changed
- Fire PermissionDetachedEvent when syncing permissions (symmetry with syncRoles) by @chengkangzai in #2963
- Fixed a bug where removing a role or permission from a model on one team could also remove that same assignment on other teams, when the model uses a custom pivot class (
->using(CustomPivot::class)) onroles()/permissions()with teams enabled. (Issue #2867) by @drbyte in #2961
Watch out for in your own test suite:
- If you use custom pivot model
deleting/deletedhooks to react to role/permission removal under teams, those hooks were already unreliable in this scenario and remain out of scope — switch to listening forRoleDetachedEvent/PermissionDetachedEventinstead. revokePermissionTo()can now throwGuardDoesNotMatchin rare cases where it previously wouldn't have, as a side effect of routing through the same guard-check used bygivePermissionTo(). This should not affect normal usage (permissions being revoked are already guard-matched), but if your tests exercise unusual multi-guard setups, re-run them against this release.
Full Changelog: 8.1.0...8.2.0