© 2026 Hedgehog Software, LLC

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

notification inside action not showing

i have code action like this but when it create, the success notification not fired
how to tackle this?
thank you!
->suffixAction(
                        Forms\Components\Actions\Action::make('newCategoryForAsset')
                            ->icon('heroicon-m-squares-plus')
                            ->form([
                                Forms\Components\TextInput::make('name')
                                    ->maxLength(255)
                                    ->required(),
                                Forms\Components\TextArea::make('note')
                            ])
                            ->mutateFormDataUsing(function (array $data): array {
                                $data['type'] = 'Asset';
                                $data['user_id'] = auth()->id();
                                return $data;
                            })
                            ->successNotification(function (array $data){
                                Notification::make()
                                ->title('Category registered')
                                ->body('Saved new '.$data['type'].' category named '.$data['name'].'.')
                                ->success();
                            })
                            ->action(function (array $data): void {
                                Category::create($data);
                            })
                    ),
->suffixAction(
                        Forms\Components\Actions\Action::make('newCategoryForAsset')
                            ->icon('heroicon-m-squares-plus')
                            ->form([
                                Forms\Components\TextInput::make('name')
                                    ->maxLength(255)
                                    ->required(),
                                Forms\Components\TextArea::make('note')
                            ])
                            ->mutateFormDataUsing(function (array $data): array {
                                $data['type'] = 'Asset';
                                $data['user_id'] = auth()->id();
                                return $data;
                            })
                            ->successNotification(function (array $data){
                                Notification::make()
                                ->title('Category registered')
                                ->body('Saved new '.$data['type'].' category named '.$data['name'].'.')
                                ->success();
                            })
                            ->action(function (array $data): void {
                                Category::create($data);
                            })
                    ),
Solution
I think
successNotification
successNotification
will be used to override the default filament actions, so you dont need it here

Forms\Components\Actions\Action::make('newCategoryForAsset')
    ->action(function (array $data): void {
        Category::create($data);

        Notification::make()
          ->title('Category registered')
          ->body('Saved new '.$data['type'].' category named '.$data['name'].'.')
          ->send()
          ->success();
    })
Forms\Components\Actions\Action::make('newCategoryForAsset')
    ->action(function (array $data): void {
        Category::create($data);

        Notification::make()
          ->title('Category registered')
          ->body('Saved new '.$data['type'].' category named '.$data['name'].'.')
          ->send()
          ->success();
    })
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

Action with Notification not showing
FilamentFFilament / ❓┊help
17mo ago
Action Modals not showing inside ViewRecords
FilamentFFilament / ❓┊help
5mo ago
Notification inside a table action
FilamentFFilament / ❓┊help
3y ago
Notification Not Showing!
FilamentFFilament / ❓┊help
2y ago