PHPackages                             yohn/laravel-livewire-modals - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. yohn/laravel-livewire-modals

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

yohn/laravel-livewire-modals
============================

Dynamic Laravel Livewire Bootstrap modals.

07PHP

Since Oct 21Pushed 3y agoCompare

[ Source](https://github.com/Yohn/laravel-livewire-modals)[ Packagist](https://packagist.org/packages/yohn/laravel-livewire-modals)[ RSS](/packages/yohn-laravel-livewire-modals/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Laravel Livewire Modals
=======================

[](#laravel-livewire-modals)

This package allows you to dynamically show your Laravel Livewire components inside Bootstrap modals.

Documentation
-------------

[](#documentation)

- [Requirements](#requirements)
- [Installation](#installation)
- [Usage](#usage)
    - [Modal Views](#modal-views)
    - [Showing Modals](#showing-modals)
    - [Mount Parameters](#mount-parameters)
    - [Hiding Modals](#hiding-modals)
    - [Emitting Events](#emitting-events)
- [Publishing Assets](#publishing-assets)
    - [Custom View](#custom-view)

Requirements
------------

[](#requirements)

- Bootstrap 5 must be installed via webpack first

Installation
------------

[](#installation)

Require the package:

```
composer require yohn/laravel-livewire-modals
```

Add the `livewire:modals` component to your app layout view:

```

```

Require `../../vendor/yohn/laravel-livewire-modals/resources/js/modals` in your app javascript file:

```
require('@popperjs/core');
require('bootstrap');
require('../../vendor/yohn/laravel-livewire-modals/resources/js/modals');
```

Usage
-----

[](#usage)

### Modal Views

[](#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:

```

            Modal title

            Modal body text goes here.

            Close
            Save changes

```

### Showing Modals

[](#showing-modals)

Show a modal by emitting the `showModal` event with the component alias:

```

    {{ __('Update Profile') }}

```

### Mount Parameters

[](#mount-parameters)

Pass parameters to the component `mount` method after the alias:

```

    {{ __('Update User #' . $user->id) }}

```

The component `mount` method for the example above would look like this:

```
namespace App\Http\Livewire\Users;

use App\Models\User;
use Livewire\Component;

class Update extends Component
{
    public $user;

    public function mount(User $user)
    {
        $this->user = $user;
    }

    public function render()
    {
        return view('users.update');
    }
}
```

### Hiding Modals

[](#hiding-modals)

Hide the currently open modal by emitting the `hideModal` event:

```

    {{ __('Close') }}

```

Or by using the Bootstrap `data-bs-dismiss` attribute:

```

    {{ __('Close') }}

```

### Emitting Events

[](#emitting-events)

You can emit events inside your views:

```

    {{ __('Close') }}

```

Or inside your components, just like any normal Livewire event:

```
public function save()
{
    $this->validate();

    // save the record

    $this->emit('hideModal');
}
```

Publishing Assets
-----------------

[](#publishing-assets)

### Custom View

[](#custom-view)

Use your own modals view by publishing the package view:

```
php artisan vendor:publish --tag=laravel-livewire-modals:views
```

Now edit the view file inside `resources/views/vendor/laravel-livewire-modals`. The package will use this view to render the component.

###  Health Score

15

—

LowBetter than 3% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity24

Early-stage or recently created project

 Bus Factor1

Top contributor holds 50% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/5c53f441885ec90d8d6e547f4c9023da12f10229c3848059e19b6aba9be1859a?d=identicon)[Yohn](/maintainers/Yohn)

---

Top Contributors

[![bastinald](https://avatars.githubusercontent.com/u/82109804?v=4)](https://github.com/bastinald "bastinald (18 commits)")[![Yohn](https://avatars.githubusercontent.com/u/2002591?v=4)](https://github.com/Yohn "Yohn (17 commits)")[![juanmanavarro](https://avatars.githubusercontent.com/u/1380040?v=4)](https://github.com/juanmanavarro "juanmanavarro (1 commits)")

### Embed Badge

![Health badge](/badges/yohn-laravel-livewire-modals/health.svg)

```
[![Health](https://phpackages.com/badges/yohn-laravel-livewire-modals/health.svg)](https://phpackages.com/packages/yohn-laravel-livewire-modals)
```

###  Alternatives

[tritum/form-element-linked-checkbox

Adds a new form element which allows the editor to create a checkbox with a linked label text. This is an extension for TYPO3 CMS.

28683.8k](/packages/tritum-form-element-linked-checkbox)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
