wire-elements/modal
Livewire v3 modal component for Laravel that supports stacked/nested child modals while preserving state. Install via Composer, dispatch openModal events to launch components with arguments, and use wire-elements-modal in your layout.
Full Changelog: https://github.com/wire-elements/modal/compare/3.0.3...3.0.4
Full Changelog: https://github.com/wire-elements/modal/compare/3.0.2...3.0.3
Full Changelog: https://github.com/wire-elements/modal/compare/3.0.1...3.0.2
Full Changelog: https://github.com/wire-elements/modal/compare/2.0.13...3.0.1
Full Changelog: https://github.com/wire-elements/modal/compare/2.0.13...3.0.0-beta
min-h-screen with min-h-dvh by @iRaziul in https://github.com/wire-elements/modal/pull/453Full Changelog: https://github.com/wire-elements/modal/compare/2.0.12...2.0.13
Fix #474 error when escape key is pressed when modal not opened
Full Changelog: https://github.com/wire-elements/modal/compare/2.0.10...2.0.11
Full Changelog: https://github.com/wire-elements/modal/compare/2.0.9...2.0.10
Full Changelog: https://github.com/wire-elements/modal/compare/2.0.7...2.0.8
Full Changelog: https://github.com/wire-elements/modal/compare/2.0.6...2.0.7
Full Changelog: https://github.com/wire-elements/modal/compare/2.0.4-beta...2.0.5-beta
php artisan vendor:publish --tag=wire-elements-modal-config
You can automate the required changes using the following command:
php artisan livewire:upgrade --run-only wire-elements-modal-upgrade
[@livewire](https://github.com/livewire)('livewire-ui-modal') with [@livewire](https://github.com/livewire)('wire-elements-modal')arguments is the named property to pass arguments to your modal, for example:$dispatch('openModal', {component: 'edit-user', arguments: {user: 5}})
Livewire v3 now expects named arguments; 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', arguments: {user: 5}})">Edit User</button>
You can use regular expression to automate this change:
// Regular Expression
emit\('openModal', '([^']+)'(?:, (\{[^}]+\}|[@js](https://github.com/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](https://github.com/js)(['foo' => 'bar']))
// Matches
$0 = emit('openModal', 'edit-user', [@js](https://github.com/js)(['foo' => 'bar']))
$1 = edit-user
$2 = [@js](https://github.com/js)(['foo' => 'bar'])
// Update all occurrences
dispatch('openModal', {component: '$1', arguments: $2});
In PHPStorm:
Full Changelog: https://github.com/wire-elements/modal/compare/1.0.7...1.0.8
Full Changelog: https://github.com/wire-elements/modal/compare/1.0.6...1.0.7
Full Changelog: https://github.com/wire-elements/modal/compare/1.0.5...1.0.6
If you published modal.blade.php you will need to replace x-on:close.stop="show = false" with x-on:close.stop="setShowPropertyTo(false)" (see diff)
Full Changelog: https://github.com/wire-elements/modal/compare/1.0.4...1.0.5
Full Changelog: https://github.com/wire-elements/modal/compare/1.0.3...1.0.4
Full Changelog: https://github.com/wire-elements/modal/compare/1.0.2...1.0.3
Breaking changes to take into account:
[@livewireUIScripts](https://github.com/livewireUIScripts) has been removed.Any required Javascript will be loaded inline. If you want to include the Javascript in your bundler like Webpack you can use the config to disable Javascript and require the necessary Javascript require('vendor/livewire-ui/modal/resources/js/modal');
livewire-ui-modalIf you published the modal view make sure to make the required changes.
The setActiveModalComponent is sometimes called multiple times resulting in issues with the component history log and could result in errors. This release prevents an already active modal component to be set active (while it is already active).
How can I help you explore Laravel packages today?