How to insert data in TextColumn using CASE query
How can I assign a value using a CASE query in a TextColumn::make() column in Filament, considering that the value depends on conditions in the model X?
This is the query
I'm not sure what value to put inside the TextColumn::make() since it wouldn't involve a direct relationship.
Ty for all.
2 Replies
You could extend the table query (
->query()
) and add this raw statement. Then access it via the text column
If this doesn’t need to happen on DB level you could just calculate the value via getStateUsing()
Thx!!