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 Koch15mo ago
Your action doesn't have an ->action()
Malcolm Turntbull
Malcolm TurntbullOP15mo 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 Koch15mo ago
Not sure whether ->action() on Section is the right thing? 🤔

Did you find this page helpful?