© 2026 Hedgehog Software, LLC

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

Remove Buttons in Action Modal

Hey guys!

I am using a suffixAction for a Select component im Filament form that opens a modal. I would like to remove the buttons at the bottom of the modal so that I just have the label "Action needed" the modal content "Test123" and the close button in the top right corner.

How can I remove/hide the buttons?

->suffixAction(function ($record, $get, $set) {
    $actionLabel = $record->course_status === Course::STATUS_ACTIVE ? 'Deactivate' : 'Activate';
    $actionIcon = $record->course_status === Course::STATUS_ACTIVE ? 'heroicon-o-x-circle' : 'heroicon-o-check-circle';
    $actionColor = $record->course_status === Course::STATUS_ACTIVE ? 'danger' : 'success';

    // if no product is set, instead show a button, that opens a modal to select a product
    if(!$record->product_id) { <--- This is the important part
        return Forms\Components\Actions\Action::make('advance')
            ->label('Action needed')
            ->icon('heroicon-o-shield-exclamation')
            ->color('danger')
            ->modalContent(view('filament.advance'))
            ->modalContentFooter()
            ->modalCloseButton();
    }

    return Forms\Components\Actions\Action::make('toggleStatus')
        ->label($actionLabel)
        ->icon($actionIcon)
        ->color($actionColor)
        ->requiresConfirmation()
        ->action(function ($record) use ($set) {
            logger('Toggling status');
            $record->course_status = $record->course_status === Course::STATUS_ACTIVE ? Course::STATUS_INACTIVE : Course::STATUS_ACTIVE;
            $record->save();
            $set('course_status', $record->course_status);
        });
})
->suffixAction(function ($record, $get, $set) {
    $actionLabel = $record->course_status === Course::STATUS_ACTIVE ? 'Deactivate' : 'Activate';
    $actionIcon = $record->course_status === Course::STATUS_ACTIVE ? 'heroicon-o-x-circle' : 'heroicon-o-check-circle';
    $actionColor = $record->course_status === Course::STATUS_ACTIVE ? 'danger' : 'success';

    // if no product is set, instead show a button, that opens a modal to select a product
    if(!$record->product_id) { <--- This is the important part
        return Forms\Components\Actions\Action::make('advance')
            ->label('Action needed')
            ->icon('heroicon-o-shield-exclamation')
            ->color('danger')
            ->modalContent(view('filament.advance'))
            ->modalContentFooter()
            ->modalCloseButton();
    }

    return Forms\Components\Actions\Action::make('toggleStatus')
        ->label($actionLabel)
        ->icon($actionIcon)
        ->color($actionColor)
        ->requiresConfirmation()
        ->action(function ($record) use ($set) {
            logger('Toggling status');
            $record->course_status = $record->course_status === Course::STATUS_ACTIVE ? Course::STATUS_INACTIVE : Course::STATUS_ACTIVE;
            $record->save();
            $set('course_status', $record->course_status);
        });
})
image.png
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

Multiple submit buttons in Action's modal
FilamentFFilament / ❓┊help
3y ago
Disable/Hide all Action Modal Buttons
FilamentFFilament / ❓┊help
3y ago
Align buttons in modal
FilamentFFilament / ❓┊help
3y ago
remove clear action from database Notifications Modal
FilamentFFilament / ❓┊help
3y ago