Dynamic Form Component
What I'm trying to achieve is to dynamically append additional form components to the parent form. The additional form components are encapsulated in a service class, and each service class has custom form components. When a user selects the service type from the dropdown, I want to take the selected state value, instantiate that service class to retrieve its form components, and then append those to the child container.
What I did:
I was able to replace the full form, but instead, I would like to append the additional form components to the parent form if possible.
Solution:Jump to solution
Thank you! This is what I managed to get working.
```php
public static function form(Form $form): Form
{...
2 Replies
you can add a section, and set its schema base on the selected service
this also can give you an idea
https://github.com/danharrin/form-builder/blob/main/app/Http/Livewire/Form.php#L31
Solution
Thank you! This is what I managed to get working.