When using BulkActionGroup inside of a BulkActionGroup get \IconSize::tryFrom() Error.

When using a nested BulkActionGroup in V4 get the following error:
Filament\Support\Enums\IconSize::tryFrom(): Argument #1 ($value) must be of type string|int, Closure given
Filament\Support\Enums\IconSize::tryFrom(): Argument #1 ($value) must be of type string|int, Closure given
this is example code with problems:
use Filament\Actions\BulkAction;
use Filament\Actions\BulkActionGroup;
use Filament\Tables\Table;

public static function table(Table $table): Table
{
return parent::table($table)->toolbarActions([
BulkActionGroup::make([
BulkActionGroup::make([
BulkAction::make('delete')
->requiresConfirmation()
->action(fn (Collection $records) => $records->each->delete()),
BulkAction::make('forceDelete')
->requiresConfirmation()
->action(fn (Collection $records) => $records->each->forceDelete()),
]),
BulkAction::make('export')->button()->action(fn (Collection $records) => ...),
]);
}
use Filament\Actions\BulkAction;
use Filament\Actions\BulkActionGroup;
use Filament\Tables\Table;

public static function table(Table $table): Table
{
return parent::table($table)->toolbarActions([
BulkActionGroup::make([
BulkActionGroup::make([
BulkAction::make('delete')
->requiresConfirmation()
->action(fn (Collection $records) => $records->each->delete()),
BulkAction::make('forceDelete')
->requiresConfirmation()
->action(fn (Collection $records) => $records->each->forceDelete()),
]),
BulkAction::make('export')->button()->action(fn (Collection $records) => ...),
]);
}
That used to work on v3 but on v4 not so much.. anyone encountered this before. didnt find any documentation change for doing this.
2 Replies
Dennis Koch
Dennis Koch3mo ago
Did you try adding an Icon to the actions or groups? Just for testing? Would help to see the full stack trace, too.
julianwayu
julianwayuOP3mo ago
I actually ended up opening an issue https://github.com/filamentphp/filament/issues/17089
GitHub
[v4.x] Having a nested BulkActionGroup with bulk actions inside of ...
Package filament/filament Package Version v4.0.0-beta19 Laravel Version v12.21.0 Livewire Version v3.6.4 PHP Version PHP 8.4.10 Problem description Having a nested BulkActionGroup inside of a BulkA...

Did you find this page helpful?