Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Wire Modals

Wire Modals Laravel Package

rishadblack/wire-modals

Wire Modals is a Laravel Livewire package for creating and managing modal dialogs directly from your components. It provides a simple API for opening, closing, and passing data to modals, making it easy to add reusable, interactive dialogs for forms, confirmations, and dynamic content with minimal s...

View on GitHub
Deep Wiki
Context7

On-demand Livewire components with Bootstrap 5 modals: mount a component when a button is clicked, call an action on it, unmount it when its modal closes.

Frequently asked questions about Wire Modals
How do I install wire-modals in a Laravel Livewire application?
Install the package with Composer using composer require rishadblack/wire-modals, then follow the repository README for any required setup. Your application should already use Laravel and Livewire and include Bootstrap 5 for the modal UI. The 1.0.1 release is documentation-only, so installation behavior is unchanged from the previous code release.
Does wire-modals require Bootstrap 5?
Yes. Wire Modals is built around Bootstrap 5 modals, so your Laravel front end should load Bootstrap 5 CSS and JavaScript. It is not a standalone modal library and does not replace Bootstrap's modal behavior. Confirm that your theme or build pipeline does not override Bootstrap modal styles or events.
Which Laravel, PHP, and Livewire versions does wire-modals support?
The exact PHP, Laravel, and Livewire version constraints are defined in the package's composer.json, so check those before installing. The 1.0.1 release adds documentation only and does not change compatibility. Verify the constraints against your application in a non-production branch before adopting the package.
How do I open a modal and pass data to a Livewire component with wire-modals?
Wire Modals mounts a Livewire component on demand when a button is clicked and supports passing data to that component. Use the package's documented API to define the trigger, target component, and payload. Keep payloads small and serializable, and authorize any sensitive data on the server before rendering it inside the modal.
Can I call an action on a mounted modal component?
Yes. The package is designed to call an action on the Livewire component after it is mounted inside the modal. Trigger that action through the package API rather than relying on client-only state. Validate input and enforce authorization server-side, and cover the action with Livewire or feature tests.
Does the Livewire component unmount when the Bootstrap modal closes?
Yes. Wire Modals unmounts the component when its modal closes, which helps release state and avoid stale dialogs. This is useful for forms and confirmation flows, but it means you should persist any data that must survive the close. Test your open and close events to confirm the lifecycle matches your application's expectations.
Does wire-modals support stacked or nested modals?
Stacked or nested modal support is not described in the package overview, blurb, or 1.0.1 release notes. Bootstrap 5 supports stacked modals, but the package's orchestration behavior may differ, so verify it in the documentation or repository issues. Test nested flows carefully before relying on them in production.
How should I test wire-modals in a Laravel application?
Use Livewire component tests to cover mounting, actions, validation, and state changes, and add feature tests for authorization around dynamically loaded components. Also test the open and close behavior through an integration test or a browser-level check. When migrating from a custom loader, add regression tests for component resolution and unauthorized access before expanding usage.
Is wire-modals safe to use in production, and how should I migrate from a custom modal loader?
Adoption risk is moderate because dynamic component loading raises security, performance, and state-management questions. The 1.0.1 migration guide proposes a staged path: inventory existing loaders, enable legacy mode, route one low-risk modal through the package behind a feature flag, compare behavior, then expand modal by modal. Keep the old loader until parity is proven, and require code review and test coverage if the guide is used for AI-assisted migration.
What changed in wire-modals 1.0.1, and does it affect existing installs?
Version 1.0.1 is documentation-only and adds docs/sylloo-migration-prompt.md, a step-by-step guide for applications with hand-rolled dynamic component or modal loaders. There are no code, API, or dependency changes in this release. Existing installs should not see runtime or breaking changes from 1.0.1.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
uni-method/symfony-lib
tacticmedia/scim-server-bundle
neika-ai/symfony-bundle
mattleads/agent-publishing-bundle
glavweb/framework-bundle
glavweb/extra-bundle
glavweb/api-bundle
glavweb/admin-bundle
adachsoft/api-version-bundle
elsayed85/laravel-api-exceptions
ouhssini/laravel-demo-mode
daworks/ncloud-outbound-mailer-driver
gp247/cms
ignibyte/aic-gates
nexa-merchant/blog
novasa/laravel-language-center
opencage/geocode
adolfoholzer/parameters
livenetworks/ln-starter
cgv/localized-resource