Button with Modal Popup
How to create simple link OR button in Filament livewire which ideally open a Modal popup?
Solution
<!-- resources/views/custom-view.blade.php -->
<div>
<x-filament::modal id="myModal">
<x-slot name="heading">
Title
</x-slot>
<div>
Content...
</div>
<x-slot name="footer">
<x-filament::button type="button" @click="$dispatch('close-modal', {id: 'myModal'})">Close</x-filament::button>
</x-slot>
</x-filament::modal>
<x-filament::button type="button" @click="$dispatch('open-modal', {id: 'myModal'})">Open Modal</x-filament::button>
</div><!-- resources/views/custom-view.blade.php -->
<div>
<x-filament::modal id="myModal">
<x-slot name="heading">
Title
</x-slot>
<div>
Content...
</div>
<x-slot name="footer">
<x-filament::button type="button" @click="$dispatch('close-modal', {id: 'myModal'})">Close</x-filament::button>
</x-slot>
</x-filament::modal>
<x-filament::button type="button" @click="$dispatch('open-modal', {id: 'myModal'})">Open Modal</x-filament::button>
</div>Forms\Components\View::make('custom-view')Forms\Components\View::make('custom-view')