Null state for table column
Hello,
I have a column in my project that is nullable, I'm trying to make a default display value for it but I'm not finding a way.
This is what I'm trying to do:
4 Replies
->formatStateUsing
Doesn't solve your problem?
https://filamentphp.com/docs/2.x/tables/columns/text#custom-formatting
Unfortunately not, I tried:
But it seems the column does not use this method if there is no value
$state will always be mixed. And you’re telling the callback to return an int, but also trying to return a string of it is null.
If you’re on v3 you could use ->default(‘N/A’)
Sorry I sent the wrong example, the return was int|string
This worked! Thanks! I was only trying with formatStateUsing 😅