File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-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 ;
12
+ use Spatie \Permission \Contracts \Role ;
11
13
12
14
class RoleAttached
13
15
{
14
16
use Dispatchable;
15
17
use InteractsWithSockets;
16
18
use SerializesModels;
17
19
18
- public function __construct (public Model $ model , public array $ roleIds )
19
- {}
20
+ /**
21
+ * Internally the HasRoles trait passes an array of role ids (eg: int's or uuid's)
22
+ * Theoretically one could register the event to other places passing other types
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 ) {}
20
28
}
You can’t perform that action at this time.
0 commit comments