Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/steelants/livewire-modal


https://github.com/steelants/livewire-modal

Last synced: 3 days ago
JSON representation

Awesome Lists containing this project

README

        

# Livevire Modal

Package for opening any Livewire component inside modal. Powered by Livewire 3 and Bootstrap 5.

### Created by: [SteelAnts s.r.o.](https://www.steelants.cz/)

[![Total Downloads](https://img.shields.io/packagist/dt/steelants/modal.svg?style=flat-square)](https://packagist.org/packages/steelants/modal)

## Usage

### Include modal in layout
```blade
@livewire('modal-basic', key('modal'))
```

### Opening modal from blade or JavaScript
```html
Open modal
```

### Opening modal from component
```php
$this->dispatch('openModal', 'livewire-component-name', 'Modal title', $componentParameters)
```

## openModal parameters
```php
/**
* Open modal
*
* @param string|Array $livewireComponents Component name, can be array
* @param string $title Modal title
* @param array $parameters Component parameters
* @return void
*/
public function openModal($livewireComponents, $title = "", $parameters = [])
```

## Example
```html
Create User

Edit User
```

```php
use Livewire\Component;

class UserForm extends Component
{
public function mount(User $user)
{
$this->user = $user;
}
}
```

## Contributors


## Other Packages
[steelants/laravel-auth](https://github.com/steelants/laravel-auth)
[steelants/laravel-boilerplate](https://github.com/steelants/Laravel-Boilerplate)
[steelants/datatable](https://github.com/steelants/Livewire-DataTable)
[steelants/form](https://github.com/steelants/Laravel-Form)
[steelants/modal](https://github.com/steelants/Livewire-Modal)
[steelants/laravel-tenant](https://github.com/steelants/Laravel-Tenant)