-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
21 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
--- | ||
title: Events | ||
weight: 5 | ||
--- | ||
|
||
By default Events are not enabled, because not all apps need to fire events related to roles and permissions. | ||
|
||
However, you may enable events by setting the `events_enabled => true` in `config/permission.php` | ||
|
||
## Available Events | ||
|
||
The following events are available since `v6.15.0`: | ||
|
||
``` | ||
\Spatie\Permission\Events\RoleAttached::class | ||
\Spatie\Permission\Events\RoleDetached::class | ||
\Spatie\Permission\Events\PermissionAttached::class | ||
\Spatie\Permission\Events\PermissionDetached::class | ||
``` | ||
Note that the events can receive the role or permission details as a model ID or as an Eloquent record, or as an array or collection of ids or records. Be sure to inspect the parameter before acting on it. | ||
|