Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

francis_sebin_fernandez's avatar

How can I save data to multiple tables in a resource

Hi, Thanks in advance

I got User and Role models, which have many to many relationships between them. I need to add a dropdown with a multi-select option for picking the roles of the users. Nova's default behavior is adding roles after creating the user. So if a user needs to create another user and assign some roles he needs to create the new user then edit that user and assign the roles. I managed to get the dropdown of roles but unable to save that role and the user resource. Is there any to overcome this? I need to save the roles at the time of user creation itself, or there any way to override the save method for that particular user resource?

0 likes
2 replies

Please or to participate in this conversation.