Adding a save button to EditPage header
So I'm trying to move the save button from the form actions to the header actions, and snatching it out of there with
How would I go about adding a custom action that actually saves the form currently being viewed in an edit page? It's a standard EditRecord page we're talking about here.
This is how I grabbed the buttons from the edit form. The cancel button works fine, but that's just a link so it should. Only the save button isn't working as intended. It's the
parent::getFormActions() and putting that into my header actions does show the button, but the button itself doesn't work, as it's no longer within the form tag.How would I go about adding a custom action that actually saves the form currently being viewed in an edit page? It's a standard EditRecord page we're talking about here.
This is how I grabbed the buttons from the edit form. The cancel button works fine, but that's just a link so it should. Only the save button isn't working as intended. It's the
Arr::first($actions) one in that list.Solution
For others trying to replicate adding a save button to the header:
Toss that into your getHeaderActions array, and you're off to the races.
Toss that into your getHeaderActions array, and you're off to the races.