© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
3 replies
usmcgator

display count matching getTableRecordClassesUsing

I have a component displaying a table and it's highlighting certain rows using the getTableRecordClassesUsing() function.

The blade file is pretty simple as it just returns the table. However, I'd like to have the count of rows matching the getTableRecordClassesUsing() available in this blade file as I'd like to do some other blade logic based on that value. I tried saving the count in a variable, but it doesn't get updated below the table after the user edits a record making it no longer match the getTableRecordClassesUsing() function. Any help would be greatly appreciated.

<div>
    {{ $this->table }}
</div>

Count matching CSS rule: {{ $this->records_match }}
<div>
    {{ $this->table }}
</div>

Count matching CSS rule: {{ $this->records_match }}
Solution
I have a component displaying a table and it's highlighting certain rows using the getTableRecordClassesUsing() function.

The blade file is pretty simple as it just returns the table. However, I'd like to have the count of rows matching the getTableRecordClassesUsing() available in this blade file as I'd like to do some other blade logic based on that value. I tried saving the count in a variable, but it doesn't get updated below the table after the user edits a record making it no longer match the getTableRecordClassesUsing() function. Any help would be greatly appreciated.

<div>
    {{ $this->table }}
</div>

Count matching CSS rule: {{ $this->records_match }}
<div>
    {{ $this->table }}
</div>

Count matching CSS rule: {{ $this->records_match }}
Jump to solution
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

Help with getTableRecordClassesUsing
FilamentFFilament / ❓┊help
3y ago
Widget Table : display records count
FilamentFFilament / ❓┊help
7mo ago
mohamedsabil83 filament tinyeditor css not matching display
FilamentFFilament / ❓┊help
12mo ago