Even listener not working on laravel 7.
This was places in my view that has a corresponding component
<button wire:click="$emit('postAdded','78')">Click</button>
Then this in script tag
<script>
window.livewire.on('postAdded', postId => {
alert('A post was added with the id of: ' + postId);
})
</script>
But refuse to work