ccsliinc / livewire-toast
An Alpine.js toast package for laravel livewire.
Installs: 22
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 1
Language:Blade
Requires
- php: ^8.1
- livewire/livewire: ^2.12
- spatie/laravel-package-tools: ^1.14.0
Requires (Dev)
- laravel/pint: ^1.0
- nunomaduro/collision: ^6.0
- nunomaduro/larastan: ^2.0.1
- orchestra/testbench: ^7.0
- pestphp/pest: ^1.21
- pestphp/pest-plugin-laravel: ^1.1
- pestphp/pest-plugin-livewire: ^1.0
- phpstan/extension-installer: ^1.1
- phpstan/phpstan-deprecation-rules: ^1.0
- phpstan/phpstan-phpunit: ^1.0
- phpunit/phpunit: ^9.5
- spatie/laravel-ray: ^1.26
README
This is a livewire toast package for laravel.
Installation
You can install the package via composer:
composer require ccsliinc/livewire-toast
You can publish the config file with:
php artisan vendor:publish --tag="livewire-toast-config"
This is the contents of the published config file:
return [ /** * Default delay in ms for automatic close; */ 'delay' => '5000', /** * Position of toast. * * 'top-left' * 'top-center' * 'top-right' * 'middle-left' * 'middle-center' * 'middle-right' * 'bottom-left' * 'bottom-center' * 'bottom-right' */ 'position' => 'bottom-right', /** * Percentage */ 'opacity' => 85, ];
Optionally, you can publish the views using
php artisan vendor:publish --tag="livewire-toast-views"
Usage
1. Add @include('livewire-toast::notification') in your template. 2. On any livewire component call: $this->notify('Message', 'Title', 'Second Title', 'type');
Arguments
- Message - The message to display.
- Title - The title of the toast.
- Secondary Title - Small text after the title.
- Toast Type - Options : success, info, error, warning
Testing
composer test
Roadmap
- Create proper component transitions (in/out)
- Support multiple css frameworks
- Do Dusk testing
Changelog
Please see CHANGELOG for more information on what has changed recently.
Credits
License
The MIT License (MIT). Please see License File for more information.