Spatie roles and permissions team feature

How to fix this issue please, I'm adding new user how can I set a value and use setPermissionsTeamId function
No description
7 Replies
GHOST-117
GHOST-11715mo ago
check fillable in ur model
Dennis Koch
Dennis Koch15mo ago
Please share some code.
AngryTestie
AngryTestieOP15mo ago
@Dennis Koch I need to set the company id using setPermissionsTeamId, I'm getting this error when I'm creating new user and setting the role.
No description
Dennis Koch
Dennis Koch15mo ago
The name should give you a hint. afterCreate() runs after creation. Therefore it is too late to add non-nullable values. Use a render hook that runs before saving.
AngryTestie
AngryTestieOP15mo ago
@Dennis Koch What should I use?sorry I'm new I also tried the beforeCreate
Dennis Koch
Dennis Koch15mo ago
I don't even know where you are using this/in which context because you never explained
Want results from more Discord servers?
Add your server