I will occasionally use a datetime field in place of a boolean field, so that I can easily track when the change was made. For instance, if I have a product that can be archived, I will use a datetime field called archived_at rather than a boolean field called archived. So the "false" state for this type of field is null.
My use case is that I'd like to display an icon in the table view to show whether or not the product is archived. My initial instinct was to use the boolean field type as such:
While this works fine, it does seem that it would be nice if the boolean field type either recognized null as false or perhaps adding a nullIcon() method.
Package
filament/filament
Package Version
v2.6.3
Laravel Version
v8.76.2
Livewire Version
v2.8.2
PHP Version
PHP 8.0.13
Bug description
I will occasionally use a datetime field in place of a boolean field, so that I can easily track when the change was made. For instance, if I have a product that can be archived, I will use a datetime field called
archived_at
rather than a boolean field calledarchived
. So the "false" state for this type of field isnull
.My use case is that I'd like to display an icon in the table view to show whether or not the product is archived. My initial instinct was to use the boolean field type as such:
However, Filament doesn't recognize the
null
state as false so the icon for false never shows. I have had to use the following code instead:While this works fine, it does seem that it would be nice if the boolean field type either recognized null as false or perhaps adding a
nullIcon()
method.Steps to reproduce
No response
Relevant log output
No response