jantinnerezo/livewire-alert
Composer 安装命令:
composer require jantinnerezo/livewire-alert
包简介
This package provides a simple alert utilities for your livewire components.
README 文档
README
Livewire Alert is a Laravel Livewire package that brings SweetAlert2 notifications to your Livewire components through a fluent, chainable API. Configure and trigger beautiful, interactive alerts with a clean PHP interface — no JavaScript required.
📖 Documentation
Full documentation, live examples, and an interactive playground are hosted at:
👉 https://livewire-alert.jantinnerezo.me
Every feature — icons, positions, toasts, timers, buttons, confirm dialogs, loading alerts, in-place updates, inputs, flash alerts, images, custom classes, dependency injection and more — is documented there with copy-pasteable snippets and runnable demos.
Requirements
- PHP 8.1 or higher
- Laravel 10.x or higher
- Livewire 3.x or 4.x
- Composer
Installation
Require the package with Composer:
composer require jantinnerezo/livewire-alert
Optionally publish the config file:
php artisan vendor:publish --tag=livewire-alert:config
Install SweetAlert2 via npm or yarn:
npm install sweetalert2
yarn add sweetalert2
Then import it in resources/js/app.js:
import Swal from 'sweetalert2' window.Swal = Swal
Or include it via CDN before the closing </body> tag:
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
Filament
Register SweetAlert2 as a Filament asset in your AppServiceProvider:
use Filament\Support\Facades\FilamentAsset; use Illuminate\Support\Facades\Vite; use Filament\Support\Assets\Js; public function boot() { FilamentAsset::register([ Js::make('sweetalert2', Vite::asset('resources/js/sweetalert2.js')), // Or via CDN: // Js::make('sweetalert2', 'https://cdn.jsdelivr.net/npm/sweetalert2@11'), ]); }
Quick taste
use Jantinnerezo\LivewireAlert\Facades\LivewireAlert; public function save() { LivewireAlert::title('Changes saved!') ->success() ->show(); }
For everything else — head to the documentation site.
Looking for v3?
The last v3 release was v3.0.3 (March 11, 2024). v4 is a major refactor introducing the fluent Facade API, dependency injection, and many more features. For v3:
composer require jantinnerezo/livewire-alert:^3.0
Upgrading to v4 is recommended for new and ongoing projects.
Testing
composer test
Contributors
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email erezojantinn@gmail.com instead of using the issue tracker.
License
The MIT License (MIT). Please see License File for more information.
jantinnerezo/livewire-alert 适用场景与选型建议
jantinnerezo/livewire-alert 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 1.34M 次下载、GitHub Stars 达 804, 最近一次更新时间为 2020 年 06 月 14 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「jantinnerezo」 「livewire-alert」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 jantinnerezo/livewire-alert 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 jantinnerezo/livewire-alert 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 jantinnerezo/livewire-alert 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A Tall Stack wrapper for noUiSlider Range Slider
A Tall Stack wrapper for noUiSlider Range Slider
A Tall Stack wrapper for noUiSlider Range Slider
This package provides a simple alert utilities for your livewire components. borrowed from jantinnerezo/livewire-alert
A Tall Stack wrapper for noUiSlider Range Slider
A Tall Stack wrapper for noUiSlider Range Slider
统计信息
- 总下载量: 1.34M
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 811
- 点击次数: 28
- 依赖项目数: 25
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-06-14