File tree 1 file changed +9
-2
lines changed 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change 8
8
use Illuminate \Database \Eloquent \Model ;
9
9
use Illuminate \Foundation \Bus \Dispatchable ;
10
10
use Illuminate \Queue \SerializesModels ;
11
+ use Illuminate \Support \Collection ;
11
12
use Spatie \Permission \Contracts \Role ;
12
13
13
14
class RoleDetached
@@ -16,6 +17,12 @@ class RoleDetached
16
17
use InteractsWithSockets;
17
18
use SerializesModels;
18
19
19
- public function __construct (public Model $ model , public Role $ role )
20
- {}
20
+ /**
21
+ * Internally the HasRoles trait passes $rolesOrIds as a single Eloquent record
22
+ * Theoretically one could register the event to other places with an array etc
23
+ * So a Listener should inspect the type of $rolesOrIds received before using.
24
+ *
25
+ * @param array|int[]|string[]|Role|Role[]|Collection $rolesOrIds
26
+ */
27
+ public function __construct (public Model $ model , public mixed $ rolesOrIds ) {}
21
28
}
You can’t perform that action at this time.
0 commit comments