Closing tab after saving changes from EditResource
I am opening an EditResource page in a new tab from the front end. Is it possible to also close the tab once the user has saved changes? I tried dispatching an event from
getSaveFormAction
action's after
method but I can't get the event to fire. Just "livewire:init" shows up in console. π€
Cancel was easier:
Solution:Jump to solution
Ok I sort-of managed to do this using
```php
protected function handleRecordUpdate(Model $record, array $data): Model
{...
3 Replies
Solution
Ok I sort-of managed to do this using
For some reason, the event was not dispatched at all either using your example or
BUT you must be opening the tab with JS (I'm assuming that what you mean by "I am opening ... a new tab from the front end"
Anyway, hope it helps
Obviously, we could both be doing something wrong π€£
Wow, thanks thats amazing.π the dispatch from handleRecordUpdate does indeed work.