© 2026 Hedgehog Software, LLC

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

Function in aftersave() is not executed

I have this custom function:

CreateTopic('3', $record->titolo, $record->testo, '56')
CreateTopic('3', $record->titolo, $record->testo, '56')


When I use it as Action it works correctly:


Action::make('Generate Topic')
    ->label('')
    ->icon('far-comments')
    ->action(function (Articoli $record): void {
        $cTopic = CreateTopic('3', $record->titolo, $record->testo, '56');
        $id_topic = json_decode($cTopic->getBody());
    },
Action::make('Generate Topic')
    ->label('')
    ->icon('far-comments')
    ->action(function (Articoli $record): void {
        $cTopic = CreateTopic('3', $record->titolo, $record->testo, '56');
        $id_topic = json_decode($cTopic->getBody());
    },


For when I use it in CreateArticle.php as afterSave(), it doesn't execute--how come?

    protected function afterSave(): void
    {
        if ($this->record->is_published === 'Published') {
            $cTopic = CreateTopic('3', $this->record->titolo, $this->record->testo, '56');
            $id_topic = json_decode($cTopic->getBody());
        }
    }
    protected function afterSave(): void
    {
        if ($this->record->is_published === 'Published') {
            $cTopic = CreateTopic('3', $this->record->titolo, $this->record->testo, '56');
            $id_topic = json_decode($cTopic->getBody());
        }
    }
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

refreshFormData in afterSave() function
FilamentFFilament / ❓┊help
12mo ago
recordAction not executed, instead toolbarAction is executed
FilamentFFilament / ❓┊help
6mo ago
Import is not executed
FilamentFFilament / ❓┊help
2y ago
Notification send before observer creating function is executed
FilamentFFilament / ❓┊help
14mo ago