get query from ListRecords\Tab within Badge() to show the actual count() of filtered query

I'm talking about this: https://filamentphp.com/docs/3.x/panels/resources/listing-records#adding-badges-to-filter-tabs in the example above, this could be quite useful for showing the number of records that pass that filter. I'm using the method modifyQueryUsing() to filter the records for every Tab, but how can I access the query to apply the count() eloquent method to display number of records within the Badge() method without manually writing the query again?
2 Replies
developer
developer12mo ago
what i'm trying to do: ->badge( fn (Builder $query) => $query->count() ) but it doesn't work
Antoine
Antoine12mo ago
Anyone have a solution? It seems a bug, it's blocked to 1 for me
Want results from more Discord servers?
Add your server
More Posts
Trait "Filament\Support\Commands\Concerns\CanValidateInput" not foundin latest release `CanValidateInput` not found. and also documentation not available about this topiHow to access current model in custom view pageI made a livewire component and included it in a view page, but how can I access the current model iCustom PageHow can I add a filament table (I would actually need multiple) to my custom page? I made it with `Advanced - Form BuilderCould you please help me understand why selecting a company name in my app results in a blank page wIs there a way to trigger an action to launch a modal from the Livewire component classIs there a way to trigger an action to launch a modal from the Livewire component class instead of tHow to show livewire component as modal window for filament table actionI am going to show a livewire component in modal window when user clicks a filament table action. ``How to get currently logged user in AppPanelProvider?In AppPanelProvider::panel() I have `$user = Auth::user();`, but the result is `NULL` i.e. it seems How to set the size of the slideover for the action?Is there a way to set the width of the slideover for when an action is triggered?Method Filament\Panel::getDomain does not exist error after composer updateHello, i just did a composer update and im now getting the following error on the console and when iHow to read the lang file/translation when registering navigationItems in a panel?E.g this displays the 'filament-panels::layout.actions.billing.label' instead of the translated labe