On closeModel(), getting error Livewire\Features\SupportLegacyModels\EloquentModelSynth::setDataOnModel(): Argument #1 ($model) must be of type Illuminate\Database\Eloquent\Model, null given
phila088 opened this issue · comments
When calling $this->closeModal()
I am getting the above error. This is called as it is in the documentation, and I cannot locate anything else in the issues regarding this. Not sure where to start.
I am calling function confirmDelete()
from a wire:click()
on a button in the modal to confirm the delete of a record. The record deletes properly, it runs $this->dispatch()
fine, and closes the modal, but then throws the error once closed.
EDIT:
After further testing, it has to do with the events. Any events fired cause the error. If I run $this->dispatch()
the error shows after close, but is present on mobile view. If it is fired with $this->closeModalWithEvents()
it is displayed after closing the modal.