How to asign to a hidden form field a role?

i tried:
Hidden::make('roles')
->relationship('roles', 'name')
->saveRelationshipsWhenHidden()
->default('User'),
Hidden::make('roles')
->relationship('roles', 'name')
->saveRelationshipsWhenHidden()
->default('User'),
` but doesnt work.
3 Replies
Patrick Boivin
Can you talk a bit more about what you are trying to do?
Dan Harrin
Dan Harrin2y ago
attach the role in an observer dont use a hidden field, they are not built for this
Falk Maria Zeitsprung
thanks
Want results from more Discord servers?
Add your server