repeater action

im trying to user and Action::make() inside a repeater but it doesnt do anything for example:
Repeater::make()
->schema([
Action::make()
->action(fn(Get $get) => dd($get))
]),
Repeater::make()
->schema([
Action::make()
->action(fn(Get $get) => dd($get))
]),
10 Replies
toeknee
toeknee4w ago
You need to give it a name to start: Action::make('my_action') The only one's you don't need to do that is on the default, edit, view, create etc as they are configured to have their own names.
Shoubasi
ShoubasiOP4w ago
it does have a name
toeknee
toeknee4w ago
Not in hte above code?
Shoubasi
ShoubasiOP4w ago
Action::make('apply')
->icon('heroicon-o-check')
->color('primary')
->size('sm')
->action(fn(Set $set, Get $get) => self::applyBulkCosts($set, $get))
Action::make('apply')
->icon('heroicon-o-check')
->color('primary')
->size('sm')
->action(fn(Set $set, Get $get) => self::applyBulkCosts($set, $get))
toeknee
toeknee4w ago
You have a repeater make, and you are including the action within the schema, that's not supported usually. Are you wanting the action to be for the individual rows?
Shoubasi
ShoubasiOP4w ago
this is what im working on
No description
toeknee
toeknee4w ago
So which part of that is the repeater? The repeater looks to be part of the lower section. Personally, I would have an afterStateUpdated and then run applyBulkCosts as it should be fairly quick.
Shoubasi
ShoubasiOP4w ago
those are two repeaters
toeknee
toeknee4w ago
Yeah so you can't do quite what you want as you want it in the place of AddAction? Which you could do if you overrode the add action I suppose.

Did you find this page helpful?