F
Filamentβ€’13mo ago
pratik

How to render json column data in table TextColumn

I have call_email json field that holds the data inserted using repeater and array casted in the model :
[{"email": "[email protected]", "phone": "+8798998786xx"}] How to show this data in TextColumn ?
6 Replies
Vp
Vpβ€’13mo ago
using TextColumn.. is there any error?
shad
shadβ€’13mo ago
did you find a solution? cuz I have the same problem πŸ˜“
pratik
pratikOPβ€’13mo ago
@Vp @shad I want to show the email from call_email field. If I use
TextColumn::make('call_email.email')
TextColumn::make('call_email.email')
it shows nothing in the table.
No description
No description
No description
No description
No description
Vp
Vpβ€’13mo ago
It seems like we cannot display repeater data with key:value in a table. but only value json data (below) is displayed correctly
// It displayed correctly using TextColumn
["[email protected]", "+87 98998xxxx"]

// this throw error
[{"email": "[email protected]", "phone": "+8798998786xx"}]
// It displayed correctly using TextColumn
["[email protected]", "+87 98998xxxx"]

// this throw error
[{"email": "[email protected]", "phone": "+8798998786xx"}]
@Dennis Koch sorry for tagging here but do you have any solution here.. Objective is to display repeater json data in a table column
Dennis Koch
Dennis Kochβ€’13mo ago
Your db column contains an array of objects. So it would be call_email.0.email to show the first one.
pratik
pratikOPβ€’13mo ago
Thank you so much @Dennis Koch @Vp
Want results from more Discord servers?
Add your server