https://github.com/jantinnerezo/livewire-alert
SweetAlert2 integration for Livewire
https://github.com/jantinnerezo/livewire-alert
alpinejs laravel livewire sweetalert2
Last synced: 24 days ago
JSON representation
SweetAlert2 integration for Livewire
- Host: GitHub
- URL: https://github.com/jantinnerezo/livewire-alert
- Owner: jantinnerezo
- License: mit
- Created: 2020-06-14T04:12:10.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2025-03-20T10:41:03.000Z (about 2 months ago)
- Last Synced: 2025-04-03T07:57:38.403Z (about 1 month ago)
- Topics: alpinejs, laravel, livewire, sweetalert2
- Language: PHP
- Homepage: https://livewire-alert.laravel.cloud
- Size: 11.2 MB
- Stars: 750
- Watchers: 12
- Forks: 80
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Livewire Alert
[](https://github.com/jantinnerezo/livewire-alert/actions)
![]()
Livewire Alert is a Laravel Livewire package designed to integrate SweetAlert2 notifications seamlessly into Livewire projects. This package simplifies the process of displaying simple, customizable alerts to users, enhancing the interactivity and user experience of your Livewire projects.
You can check the interactive demo here: [livewire-alert.laravel.cloud](https://livewire-alert.laravel.cloud)
## Requirements
- PHP 8.1 or higher
- Laravel 10.x or higher
- Livewire 3.x
- Composer## Installation
First, require the package with Composer:
``` bash
composer require jantinnerezo/livewire-alert
```Optionally, if you want to customize the global configuration, you can publish the config file:
``` bash
php artisan vendor:publish --tag=livewire-alert:config
```Next, install SweetAlert2 via npm or yan:
NPM
``` bash
npm install sweetalert2
```Yarn
``` bash
yarn add sweetalert2
```After installing SweetAlert2, import it into your `resources/js/app.js` file
``` js
import Swal from 'sweetalert2'window.Swal = Swal
```If you prefer not to use package manager installation, you can include SweetAlert2 directly via CDN. Add the following script to your Blade layout file `(e.g., resources/views/layouts/app.blade.php)` before the closing `