Download the PHP package bastinald/laravel-livewire-toasts without Composer
On this page you can find all versions of the php package bastinald/laravel-livewire-toasts. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download bastinald/laravel-livewire-toasts
More information about bastinald/laravel-livewire-toasts
Files in bastinald/laravel-livewire-toasts
Package laravel-livewire-toasts
Short Description Dynamic Laravel Livewire Bootstrap toasts.
License MIT
Homepage https://github.com/bastinald/laravel-livewire-toasts
Informations about the package laravel-livewire-toasts
Laravel Livewire Toasts
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/bastinald/laravel-livewire-toasts/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/laravel-livewire-toasts
. The package will use this view to render the component.