github wire-elements/modal 2.0.0-beta
Beta release for Livewire v3

latest releases: 2.0.12, 2.0.11, 2.0.10...
pre-release15 months ago

Livewire v3 now expects named parameters; this means you will have to adjust your events.

<-- Before -->
<button wire:click="$emit('openModal', 'users')">Show Users</button>
<!-- After -->
<button wire:click="$dispatch('openModal', {component: 'users'})">Show Users</button>

<-- Before -->
<button wire:click="$emit('openModal', 'edit-user', {user: 5})">Edit User</button>
<!-- After -->
<button wire:click="$dispatch('openModal', {component: 'edit-user', parameters: {user: 5}})">Edit User</button>

You can use regular expression to automate this change:

// Regular Expression
emit\('openModal', '([^']+)'(?:, (\{[^}]+\}|@js\(\[[^\]]+\]\)))?\)

// Example 1
$emit('openModal', 'edit-user', {user: 5})

// Matches
$0 = emit('openModal', 'edit-user', {user: 5})
$1 = edit-user
$2 = {user: 5}

// Example 2
$emit('openModal', 'edit-user', @js(['foo' => 'bar']))

// Matches
$0 = emit('openModal', 'edit-user', @js(['foo' => 'bar']))
$1 = edit-user
$2 = @js(['foo' => 'bar'])

// Update all occurrences
dispatch('openModal', {component: '$1', params: $2});

In PHPStorm:
image

Don't miss a new modal release

NewReleases is sending notifications on new releases.