F
Filament3mo ago
hxn

Multi dimensional KeyValue

Hello, Is there an easy way to deal with multi dimensional array with the keyvalue component? For now i got a [object Object] in the value. I can't even save the resource because the keyvalue awaiting a ?string Maybe it is possible to ask filament to ignore the values if its an array? Exemple of my data (casted as an array) "{"name": "CompanyName", "address": {"country": "USA", "postcode": "44"}, "status": "ok"}"
5 Replies
hxn
hxn3mo ago
No description
toeknee
toeknee3mo ago
->formatStateUsing(fn($state) => ) on the address input
hxn
hxn3mo ago
Thanks for your reply @toeknee What i'm supposed to do with formatStateUsing? How do I target the specific address input and disable it?
toeknee
toeknee3mo ago
You add it to the TextInput where the value is? then if is object return the options?
hxn
hxn3mo ago
All i have is two KeyValue component Forms\Components\KeyValue::make('company'), Forms\Components\KeyValue::make('company.address'),