Livewire form submit button to Custom page header
Hi,
I have a form, I want to move the submit button of this form to the header. For this, I created an action in the header of my filament page, but how do I assign the function to this button?
My Filament Page :
protected function getHeaderActions(): array
{
return [
Action::make('update')
->requiresConfirmation()
->action(fn () => $this->update()),
];
}
Livewire comp:
public function update(): void
{
Settings::first()->update($this->form->getState());
}
livewire view:
<form wire:submit="update">
{{ $this->form }}
<x-filament::button type="submit" class="mt-6 w-full">
<span class="block" wire:loading.class="hidden"> Kaydet </span>
<span class="hidden" wire:loading wire:loading.class="block">Kaydediliyor...</span>
</x-filament::button>
</form>
And after submit i get this:
Method App\Filament\Pages\Settings::update does not exist.
0 Replies