Hello @ geometry dash breeze, as I know, the error "Unable to resolve dependency [Parameter #0 [ $event ]] in class App\Livewire\Modal" typically occurs when a Livewire component is unable to resolve a dependency due to changes in the Livewire version or the way events are handled. In Livewire 3, there have been changes in event handling that might be causing this issue. Livewire 3 introduced changes in event handling. Instead of passing the event as a parameter in Livewire component methods, I think you need to access the event properties directly. Modify your Livewire component as follows:
class Modal extends Component
{
protected $listeners = ['openModal', 'closeModal']; public $liveWireComponent = null; public $liveWireParams = [];
public function openModal($event)
{
$this->liveWireComponent = $event['liveWireComponent'];
$this->liveWireParams = json_decode($event['liveWireParams'], true);
}
public function closeModal()
{
$this->liveWireComponent = null;
$this->liveWireParams = [];
}
}