PHPackages                             mikield/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. mikield/laravel-livewire-modals

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

mikield/laravel-livewire-modals
===============================

Dynamic Laravel Livewire Bootstrap modals.

00PHP

Since Apr 13Pushed 3y agoCompare

[ Source](https://github.com/mikield/laravel-livewire-modals)[ Packagist](https://packagist.org/packages/mikield/laravel-livewire-modals)[ RSS](/packages/mikield-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 bastinald/laravel-livewire-modals
```

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

```

```

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

```
require('@popperjs/core');
require('bootstrap');
require('../../vendor/bastinald/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

13

—

LowBetter than 1% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity0

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity22

Early-stage or recently created project

 Bus Factor1

Top contributor holds 90% 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/c09f5d958678ab878b45cc7da74fe13e760901a69145f7a3b8b0ceafb109d5f4?d=identicon)[mikield](/maintainers/mikield)

---

Top Contributors

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

### Embed Badge

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

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

###  Alternatives

[yurunsoft/swoole-co-pool

26388.0k1](/packages/yurunsoft-swoole-co-pool)[burdamagazinorg/thunder-project

Project template for Thunder projects with composer

2727.1k](/packages/burdamagazinorg-thunder-project)

PHPackages © 2026

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