F
Filamentβ€’2mo ago
yoursjarvis

Is it possible to add loading indicator on a custom Action Button

Hello everyone, I have a custom page for updating user profile. Is it possible to add a loading indicator to the action button, similar to what typical resource save buttons offer?
protected function getUpdateProfileFormActions(): array
{
return [
Action::make('updateProfileAction')
->label('Save')
->submit('editProfileForm'),
];
}
protected function getUpdateProfileFormActions(): array
{
return [
Action::make('updateProfileAction')
->label('Save')
->submit('editProfileForm'),
];
}
No description
Solution:
shouldn't it be ->submit('updateProfile') ?...
Jump to solution
6 Replies
LeandroFerreira
LeandroFerreiraβ€’2mo ago
->target() ? I think submit should do this..
yoursjarvis
yoursjarvisβ€’2mo ago
@Leandro Ferreira hello, I really appreciate you assistance but I think there is no target method available
No description
LeandroFerreira
LeandroFerreiraβ€’2mo ago
yes, I see... target in the <x-filament::button>, actually Is it a custom page?
yoursjarvis
yoursjarvisβ€’2mo ago
@Leandro Ferreira yes sir it is a custom page
<x-filament-panels::page>
<x-filament-panels::form wire:submit="updateProfile">
{{ $this->editProfileForm }}
<x-filament-panels::form.actions
:actions="$this->getUpdateProfileFormActions()"
></x-filament-panels::form.actions>
</x-filament-panels::form>

<x-filament-panels::form wire:submit="updatePassword">
{{ $this->editPasswordForm }}
<x-filament-panels::form.actions
:actions="$this->getUpdatePasswordFormActions()"
/>
</x-filament-panels::form>
</x-filament-panels::page>
<x-filament-panels::page>
<x-filament-panels::form wire:submit="updateProfile">
{{ $this->editProfileForm }}
<x-filament-panels::form.actions
:actions="$this->getUpdateProfileFormActions()"
></x-filament-panels::form.actions>
</x-filament-panels::form>

<x-filament-panels::form wire:submit="updatePassword">
{{ $this->editPasswordForm }}
<x-filament-panels::form.actions
:actions="$this->getUpdatePasswordFormActions()"
/>
</x-filament-panels::form>
</x-filament-panels::page>
and this is the blade file of that page
Solution
LeandroFerreira
LeandroFerreiraβ€’2mo ago
shouldn't it be ->submit('updateProfile') ?
yoursjarvis
yoursjarvisβ€’2mo ago
@Leandro Ferreira yes it is... thank you sir really thank you pointing out this mistake. πŸ™πŸ™