© 2026 Hedgehog Software, LLC

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

Refreshing Table after Attach Action

Hi everyone,
I have two models Tag and Contact. In the View Tag page i want to see the list of tagged contacts.
I have an attach button where I can tag other contacts.
I have in the heading the counter of how many contacts that tag record has.

However, when I attach a new contact to the tag the counter is not updated.

Do you have any idea how to update the counter or move it where it can be updated?

This is the table:
    public function table(Table $table): Table
    {

        return $table
            ->heading('Contacts: ' . $this->ownerRecord->contacts->count())
            ->recordTitleAttribute('full_name')
            ->columns([
                Tables\Columns\TextColumn::make('full_name'),
                Tables\Columns\TextColumn::make('email'),
                Tables\Columns\TextColumn::make('created_at')
                ->label('Tagged At')->dateTime('j F Y, H:i'),
            ])
            ->headerActions([
                Tables\Actions\AttachAction::make()
                ->color('info')
                ->preloadRecordSelect()
                ->after(function () {
                        // What can i add here?
                }),
            ])
    public function table(Table $table): Table
    {

        return $table
            ->heading('Contacts: ' . $this->ownerRecord->contacts->count())
            ->recordTitleAttribute('full_name')
            ->columns([
                Tables\Columns\TextColumn::make('full_name'),
                Tables\Columns\TextColumn::make('email'),
                Tables\Columns\TextColumn::make('created_at')
                ->label('Tagged At')->dateTime('j F Y, H:i'),
            ])
            ->headerActions([
                Tables\Actions\AttachAction::make()
                ->color('info')
                ->preloadRecordSelect()
                ->after(function () {
                        // What can i add here?
                }),
            ])

I tried using the after action, however:
-
$this->resetTable();
$this->resetTable();
does not work
-
$this->dispatch('$refresh)
$this->dispatch('$refresh)
gives error

Any help?
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Refreshing table records after a page action
FilamentFFilament / ❓┊help
3y ago
Preventing StatsOverviewWidget from refreshing after every table action
FilamentFFilament / ❓┊help
6mo ago
Refreshing parent page after an action in a relation table
FilamentFFilament / ❓┊help
3y ago