Is it possible to add an Action to an Infolist Section header?

I've been trying something like the following, but it doesn't seem to display:
return $infolist
->schema([
Section::make('overview')
->action(
Action::make('add-new-project')
->form(fn (Form $form): Form => ProjectResource::form($form) )
->size(ActionSize::ExtraSmall)
)
->columns(8)
->heading('Project Overview')
->schema([
//
])
]);
return $infolist
->schema([
Section::make('overview')
->action(
Action::make('add-new-project')
->form(fn (Form $form): Form => ProjectResource::form($form) )
->size(ActionSize::ExtraSmall)
)
->columns(8)
->heading('Project Overview')
->schema([
//
])
]);
I can get Actions to display everywhere else, but they don't seem to want to sit in the header strip, right where they'd be most useful! I've tried the Action method, the RegisterActions method...
3 Replies
Dennis Koch
Dennis Koch14mo ago
Your action doesn't have an ->action()
Malcolm Turntbull
Malcolm TurntbullOP14mo ago
it did! I just chopped it out for the sake of brevity here. is it possible the action would fail to be added if there was a problem evaluating the ->action lambda?
Dennis Koch
Dennis Koch14mo ago
Not sure whether ->action() on Section is the right thing? 🤔
Want results from more Discord servers?
Add your server