Dynamic form for a products attributes
I want to display a form where the product attributes can be update.
Example db schema:
I'm able to generate the fields using
But the I can't set the field value, instead of seeing "value!" the input field is empty.
1 Reply
One important thing is missing from your post, are you editing or creating a new record?
Becuase the
default
property won't work on edit, only on create.
If that's your case, you want to use the afterStateHydrated
and inject your component and model record so you do something like this:
what throws me off is your loop, have you looked into Relation Managers?
https://filamentphp.com/docs/3.x/panels/resources/relation-managers