#Get the block's key when using ->extraItemActions()
4 messages · Page 1 of 1 (latest)
What do you mean 'what type of block it is?'
You can get the uuid in the $arguments parameter
An example can be found here
https://filamentphp.com/docs/3.x/forms/fields/repeater#adding-extra-item-actions-to-a-repeater
The uuid I have, yes. But each block has a key. I need the key.
I guess you can try using $component->getChildComponents() ?
Builder::make('stuff')
->extraItemActions([
\Filament\Forms\Components\Actions\Action::make('testAction')
->icon('heroicon-m-user')
->action(function ($state, array $arguments, $component): void {
dd($component->getChildComponents()[0]->getName());
})
])
->blocks([
Block::make('test')
->schema([
TextInput::make('content'),
])
])