urbycoz
How can I show styled text if a cell is empty?
Thanks both. HtmlString was the key for me.
TextColumn::make('description')
->label('Description')
->default(new HtmlString('<span class="px-3 py-1 bg-blue-100 text-blue-800 text-sm rounded-full">Empty</span>'))
5 replies
Why doesn't my filter badge update when I apply a filter?
I've finally got it working by using:
->indicateUsing(function (array $data): ?string {
if (! $data['accountid']) {
return null;
}
return 'Account ID: '.$data['accountid'];
})
I don't really understand why this is required but hey.
12 replies
Why doesn't my filter badge update when I apply a filter?
Ok I'll try and do that.
I've just been looking through the Filament source code. It seems the badge simply counts the number of filter indicators present and they don't appear when I apply my filter, even though the filtering itself seems to work ok.
12 replies