How to get hidden values in getState()

Is it possible to get also the hidden input values when I use form->getState()? I use ->hidden(fn (Closure $get) to hide input fields, but need to use the values on submit.
7 Replies
slamx_
slamx_OP2y ago
Found a solution by my self, if needed to: you can call getRawState() which geturns all fields, also hidden
Dennis Koch
Dennis Koch2y ago
Why would you hide a field when you need the value?
slamx_
slamx_OP2y ago
@Dennis Koch I use Hide to display options per User ID selected via Select
Dennis Koch
Dennis Koch2y ago
Still don’t understand why you need those values if they need to be hidden for that user
slamx_
slamx_OP2y ago
It's all about the overview, since there are no collapse options in the form and a separate form should not be created for each user, we use the ->Hidden(closure) to show and hide the settings per user. Maybe there is a another solution?
Dennis Koch
Dennis Koch2y ago
Still not sure why you need to store data, that's apparently not relevant. Sounds like you want to save defaults/fallback.
slamx_
slamx_OP2y ago
Instead of tabs or similar, the administrator should be able to make user settings and select the respective user via Select, after the selection appears the respective fields for the user. At the end save all user values accordingly.

Did you find this page helpful?