Skip to content

Refresh changes after restore #4

Answered by andreia
howdu asked this question in Q&A
Discussion options

You must be logged in to vote

@howdu I'm glad you like it! :)

In this new release the auditRestored event has been added (emitted when the audit is restored) so you can listen to it and use it as you see fit.

I was testing the Livewire's $refresh on the Edit page, but isn't working using directly on listeners:

protected $listeners = ['auditRestored' => '$refresh'];

or in a custom method:

protected $listeners = ['auditRestored'];

public function auditRestored()
{
    $refresh;
}

Using something like this is working:

public function auditRestored()
{
    $attributes = $this->record->attributesToArray();
    $data = $this->mutateFormDataBeforeFill($attributes);

    $this->form->fill($data);
}

Please let me know if it w…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@howdu
Comment options

Answer selected by howdu
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants