© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
1 reply
Ateus

Add Table to BulkAction

Hey. Can i add a table to this bulk action? I've tried using $this->table but i'm not sure how it works, could someone nudge me in the right direction?

<?php

namespace App\Filament\Tables\Actions;

class JoinProductsBulkAction extends BulkAction
{
    use CanCustomizeProcess;

    public static function getDefaultName(): ?string
    {
        return 'delete';
    }

    protected function setUp(): void
    {
        parent::setUp();

        $this->label(__('Join multiple'));

        $this->modalHeading(fn (): string => __('filament-actions::delete.multiple.modal.heading', ['label' => $this->getPluralModelLabel()]));

        $this->modalSubmitActionLabel(__('filament-actions::delete.multiple.modal.actions.delete.label'));

        $this->successNotificationTitle(__('filament-actions::delete.multiple.notifications.deleted.title'));

        $this->color('danger');

        $this->icon(FilamentIcon::resolve('actions::delete-action') ?? 'heroicon-m-trash');

        //        $this->requiresConfirmation();

        $this->modalIcon(FilamentIcon::resolve('actions::delete-action.modal') ?? 'heroicon-o-trash');

        $this->form([

            TextInput::make('New name')
                ->required(),
        ]);

        $this->action(function (): void {
            $this->process(static fn (Collection $records) => $records->each(fn (Model $record) => $record->delete()));

            $this->success();
        });

        $this->slideOver();

        $this->closeModalByClickingAway(false);

        $this->deselectRecordsAfterCompletion();
    }
}
<?php

namespace App\Filament\Tables\Actions;

class JoinProductsBulkAction extends BulkAction
{
    use CanCustomizeProcess;

    public static function getDefaultName(): ?string
    {
        return 'delete';
    }

    protected function setUp(): void
    {
        parent::setUp();

        $this->label(__('Join multiple'));

        $this->modalHeading(fn (): string => __('filament-actions::delete.multiple.modal.heading', ['label' => $this->getPluralModelLabel()]));

        $this->modalSubmitActionLabel(__('filament-actions::delete.multiple.modal.actions.delete.label'));

        $this->successNotificationTitle(__('filament-actions::delete.multiple.notifications.deleted.title'));

        $this->color('danger');

        $this->icon(FilamentIcon::resolve('actions::delete-action') ?? 'heroicon-m-trash');

        //        $this->requiresConfirmation();

        $this->modalIcon(FilamentIcon::resolve('actions::delete-action.modal') ?? 'heroicon-o-trash');

        $this->form([

            TextInput::make('New name')
                ->required(),
        ]);

        $this->action(function (): void {
            $this->process(static fn (Collection $records) => $records->each(fn (Model $record) => $record->delete()));

            $this->success();
        });

        $this->slideOver();

        $this->closeModalByClickingAway(false);

        $this->deselectRecordsAfterCompletion();
    }
}
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

Widget Table BulkAction
FilamentFFilament / ❓┊help
2y ago
How to run a BulkAction on selected to table records
FilamentFFilament / ❓┊help
2y ago
My Bulkaction buttons do not fit in the table, can we add scroll?
FilamentFFilament / ❓┊help
16mo ago
$table->bulkActions() or $table->prependBulkActions()
FilamentFFilament / ❓┊help
3y ago