filling fields based on content of other fields.

I have a textarea where users are expected to paste in some structured XML, I would like to take the attributes of the top level XML Element and set the other fields in the form to these element's values and remove the top level element before it is stored into the database. Is logic and parsing like this possible with vanilla filament? I expect I'll have to use some sort of regex unless XML parsing is possible at runtime like this.
Solution:
The Filament part would be using ```php ->live() ->afterStateUpdated(fn (Set $set) => parse and set fields)...
Jump to solution
1 Reply
Solution
Dennis Koch
Dennis Koch13mo ago
The Filament part would be using
->live()
->afterStateUpdated(fn (Set $set) => parse and set fields)
->live()
->afterStateUpdated(fn (Set $set) => parse and set fields)
PHP should come with SimpleXML extension by default which you could use: https://www.php.net/manual/de/book.simplexml.php
Want results from more Discord servers?
Add your server