© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•2y ago•
5 replies
Patie

Records count in table header

Hi, its possible to have current records count (init, but also after filtering or searching) in table header? I tried multiple ways, but without luck yet.
Solution
looks like its working with:

    public function updated()
    {
        $this->total = $this->getFilteredTableQuery()->count();
        $this->getTable()->header($this->getTableHeader());
    }

    public function rendering()
    {
        $this->total = $this->getFilteredTableQuery()->count();
        $this->getTable()->header($this->getTableHeader());
    }

    protected function getTableHeader(): ?View
    {
        if ($this->total > 0) {
            return view('components.banner', ['message' => $this->total, 'style' => 'warning']);
        }
        return null;
    }
    public function updated()
    {
        $this->total = $this->getFilteredTableQuery()->count();
        $this->getTable()->header($this->getTableHeader());
    }

    public function rendering()
    {
        $this->total = $this->getFilteredTableQuery()->count();
        $this->getTable()->header($this->getTableHeader());
    }

    protected function getTableHeader(): ?View
    {
        if ($this->total > 0) {
            return view('components.banner', ['message' => $this->total, 'style' => 'warning']);
        }
        return null;
    }


its correct way how to do it?
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

Widget Table : display records count
FilamentFFilament / ❓┊help
7mo ago
Count selected records in Table Builder Bulk Action form
FilamentFFilament / ❓┊help
3y ago
How to get all table records in header action
FilamentFFilament / ❓┊help
2y ago