nawasara/modal
Nawasara Modal
Reusable Blade and Livewire modal component for Laravel applications.
Installation
composer require nawasara/modal
Auto-discovered. Optionally publish the views to override the defaults:
php artisan vendor:publish --provider="Nawasara\Modal\ModalServiceProvider"
Usage
Blade modal
<x-nawasara-modal::modal id="my-modal" title="Modal Title">
Modal content goes here.
<x-slot:footer>
<button @click="open = false">Close</button>
</x-slot:footer>
</x-nawasara-modal::modal>
Open the modal from anywhere on the page:
<button @click="openModal('my-modal')">Open modal</button>
Livewire modal (universal)
Drop the universal modal once in your layout:
<livewire:nawasara-modal.livewire-modal />
Then open any Livewire component inside it:
openModal({
id: 'modal-livewire',
title: 'Title',
component: 'your.livewire.component',
params: { /* ... */ }
});
Author
Pringgo J. Saputro <odyinggo@gmail.com>
License
MIT