Skip to content

Commit c08e0f2

Browse files
authored
Expand event signature
1 parent 3b76bed commit c08e0f2

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/Events/PermissionDetached.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,11 @@ class PermissionDetached
1818
use SerializesModels;
1919

2020
/**
21-
* @param Model $model
22-
* @param Permission|Permission[]|Collection $permission
21+
* Internally the HasPermissions trait passes $permissionsOrIds as an Eloquent record.
22+
* Theoretically one could register the event to other places and pass an array etc.
23+
* So a Listener should inspect the type of $permissionsOrIds received before using.
24+
*
25+
* @param array|int[]|string[]|Permission|Permission[]|Collection $permissionsOrIds
2326
*/
24-
public function __construct(public Model $model, public mixed $permission)
25-
{}
27+
public function __construct(public Model $model, public mixed $permissionsOrIds) {}
2628
}

0 commit comments

Comments
 (0)