windsondias / livewire-toasts
A Livewire package to create toast notifications
Package info
github.com/windsondias/livewire-toasts
Language:Blade
pkg:composer/windsondias/livewire-toasts
v0.1.1
2023-11-19 20:32 UTC
Requires
- illuminate/support: ^10.32
- livewire/livewire: ^3.2
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
To use this package, you must have TailwindCss and AlpineJs installed in the project.
The icon library used in the package is remixicon.com
Installation
Use the composer command:
composer require windsondias/livewire-toasts
It is also necessary to add the relative path to the package folder in tailwind.config.js within the content key, starting from the vendor folder:
content: [
"./resources/**/*.blade.php",
"./resources/**/*.js",
"./vendor/windsondias/livewire-toasts/resources/**/*.blade.php",
],
Add the component to your layout
<body>
@persist('toast')
<x-toasts::render/>
@endpersist
</body>
To use, simply call from a livewire component:
$this->success('Message');
$this->error('Message');
$this->information('Message');
$this->warning('Message');
To change the toast layout, simply publish the package
php artisan vendor:publish --tag=livewire-toasts