execute function in resource from edit

Hi, in PfcResource.php i have a static function:
public static function CalcoliQta(\Closure $get, callable $set, $livewire, $context = '')
{...
public static function CalcoliQta(\Closure $get, callable $set, $livewire, $context = '')
{...
I want to execute it when the record is in edit mode: how??
2 Replies
Husky110
Husky1102y ago
I think afterStateHydrated is what you are looking for: https://filamentphp.com/docs/2.x/forms/advanced#hydration
Filament
Advanced - Form Builder - Filament
The elegant TALL stack form builder for Laravel artisans.
Husky110
Husky1102y ago
or you can setup an event (Livewire has an init-event which is fired, after a component has finished loading): https://filamentphp.com/docs/2.x/forms/advanced#using-form-events
Filament
Advanced - Form Builder - Filament
The elegant TALL stack form builder for Laravel artisans.

Did you find this page helpful?