wire-elements / modal

Livewire component that provides you with a modal that supports multiple child modals while maintaining state.
MIT License
1.09k stars 129 forks source link

"modalClosed"-event name as parameter? #419

Closed noxomix closed 4 months ago

noxomix commented 4 months ago

Hello,

According to the documentation there is a component name provided as a parameter when the modalClosed is triggered? The name of the closed component will be provided as a parameter;

But how can I access this component name? If I simply write a parameter into my listenening function (with On('modalClosed')) there is like

Unable to resolve dependency [Parameter #0 [ <required> $x ]

Maybe I missunderstood something... or is this not implemented yet?

Best Regards

noxomix commented 4 months ago

Okay I figured out:

The Function Parameter must be named like the actual parameter so with:

#[On('modalClosed)]
public function something($name) {
    ....
}

It will work. Thanks anyways.