Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/steelants/livewire-modal
https://github.com/steelants/livewire-modal
Last synced: 2 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/steelants/livewire-modal
- Owner: steelants
- License: mit
- Created: 2023-09-20T08:02:47.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-04-09T14:26:38.000Z (9 months ago)
- Last Synced: 2024-05-09T23:41:58.526Z (8 months ago)
- Language: PHP
- Size: 29.3 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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 UserEdit User
``````php
use Livewire\Component;class UserForm extends Component
{
public function mount(User $user)
{
$this->user = $user;
}
}
```## 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)