Download the PHP package pleshkovpa/toasts-livewire without Composer
On this page you can find all versions of the php package pleshkovpa/toasts-livewire. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download pleshkovpa/toasts-livewire
More information about pleshkovpa/toasts-livewire
Files in pleshkovpa/toasts-livewire
Package toasts-livewire
Short Description Bootstrap toasts for Laravel Livewire
License MIT
Homepage https://github.com/pleshkovpa/toasts-livewire
Informations about the package toasts-livewire
Toasts for Laravel Livewire with Bootstrap 5
This package allows you to dynamically show Bootstrap toasts via Laravel Livewire components.
Documentation
- Requirements
- Installation
- Usage
- Showing Toasts
- Emitting Events
- Publishing Assets
- Custom Config
- Custom View
Requirements
- Bootstrap 5 must be installed via webpack first
Installation
Require the package:
Add the livewire:toasts
component to your app layout view:
Require ../../vendor/pleshkovpa/toasts-livewire/resources/js/toasts
in your app javascript file:
Usage
Showing Toasts
Show a toast by emitting the showToast
event with the color & message:
The color should be a Bootstrap color name e.g. success
, danger
, info
.
Emitting Events
You can emit events inside your views:
Or inside your components, just like any normal Livewire event:
Publishing Assets
Custom Config
Customize the toasts configuration by publishing the config file:
Now you can easily change things like the hide delay and error message.
Custom View
Use your own toasts view by publishing the view file:
Now edit the view file inside resources/views/vendor/toasts-livewire
. The package will use this view to render the component.