Update attribute outside of form
Is it possible to update an attribute outside a form on
afterStateUpdated()
? I can update any field in the form with $set()
, but can you do it with other attributes that are not part of the form?Solution:Jump to solution
I'm making calculations on a form but the total has to be reflected somewhere else on the page/component. This seems to work (simplified), not sure though if this is the right way.
```php
->afterStateUpdated(function (Livewire $livewire) {
$livewire->total = 12345;
}...
3 Replies