Download the PHP package smirltech/livewire-modals without Composer
On this page you can find all versions of the php package smirltech/livewire-modals. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download smirltech/livewire-modals
More information about smirltech/livewire-modals
Files in smirltech/livewire-modals
Package livewire-modals
Short Description Dynamic Laravel Livewire Bootstrap modals.
License MIT
Homepage https://github.com/smirltech/livewire-modals
Informations about the package livewire-modals
Livewire Modals
This package allows you to dynamically show your Laravel Livewire components inside Bootstrap modals.
Documentation
- Requirements
- Installation
- Usage
- Modal Views
- Showing Modals
- Mount Parameters
- Hiding Modals
- Emitting Events
- Publishing Assets
- Custom View
Requirements
Install Bootstrap 5 and Popper.js 2 in your app. See the Bootstrap 5 docs for more information.
Require bootstrap
and popper.js
packages in your
app javascript file. Then import the Modal
class from bootstrap
and add it to the window
object.
Using mix
Using vite
Installation
Require the package:
Add livewire:modals
and x-modals::scripts
components to your layout:
Usage
Modal Views
Make a Livewire component you want to show as a modal. The view for this component must use the Bootstrap modal-dialog
container:
Alternatively, you can use the x-modals::base
or x-modals::form
component:
Showing Modals
Show a modal by emitting the showModal
event with the component alias:
Outside of Livewire components, you can use the Livewire.emit
method:
or
Mount Parameters
Pass parameters to the component mount
method after the alias:
The component mount
method for the example above would look like this:
Hiding Modals
Hide the currently open modal by emitting the hideModal
event:
Or by using the Bootstrap data-bs-dismiss
attribute:
Emitting Events
You can emit events inside your views:
Or inside your components, just like any normal Livewire event:
Publishing Assets
Custom View
Use your own modals view by publishing the package view:
Now edit the view file inside resources/views/vendor/livewire-modals
. The package will use this view to render the
component.
All versions of livewire-modals with dependencies
laravel/framework Version ^10.0|^9.0|^8.0
livewire/livewire Version ^3.0
spatie/laravel-package-tools Version ^1.0