uvatechs / livewire-sweetalert
Reusable SweetAlert integration for Laravel Livewire
Installs: 0
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/uvatechs/livewire-sweetalert
Requires
- php: ^8.0
- livewire/livewire: ^3.0
This package is not auto-updated.
Last update: 2025-12-26 14:02:03 UTC
README
A simple reusable package to integrate SweetAlert2 with Laravel Livewire.
Installation
- Add the package to your Laravel app (if locally linked):
composer require uvatechs/livewire-sweetalert
- Add component to your layout:
<livewire:sweet-alert />
- Use the trait in your Livewire components:
use Uvatechs\\LivewireSweetAlert\\Traits\\WithSweetAlert; class SomeComponent extends Component { use WithSweetAlert; public function save() { $this->alert('Saved!', 'Item saved successfully.', 'success'); } }
- Trigger confirmation dialogs:
$this->confirm('deleteConfirmed', ['id' => $id], [ 'title' => 'Are you sure?', 'text' => 'This action cannot be undone.', ]);
public function deleteConfirmed($id) { // Handle confirmed deletion... }
Publishing Views
php artisan vendor:publish --tag=views
Contributing
Contributions are welcome! Feel free to open issues or submit pull requests.
License
This package is open-sourced software licensed under the MIT license.