MIT License

项目介绍

realrashid/sweet-alert 是一个托管在 GitHub 上的开源项目,主要使用 PHP 编写,采用 MIT License 许可证,目前获得 1.2k 个 Star、166 次 Fork。

仓库全名
realrashid/sweet-alert
开源许可证
MIT License
Star 数
1.2k
Fork 数
166
未关闭 Issue
9

README 摘要

Laravel SweetAlert A beautiful, responsive, customizable, accessible (WAI-ARIA) replacement for JavaScript popup boxes for Laravel — rebuilt from scratch with a fluent, Laravel-native API. Features Fluent Builder API — Chain methods naturally like Laravel Eloquent Full SweetAlert2 Coverage — Inputs, deny buttons, pre-confirm, animations, themes, and more Three Purpose-Built Builders — AlertBuilder, ToastBuilder, and…

完整内容见 GitHub 原始 README 或本页 。

常见问题

sweet-alert 用什么语言开发?

主要使用 PHP 编写,采用 MIT License 许可证,目前有 1.2k 个 Star。

sweet-alert 可以免费商用吗?

仓库采用 MIT License 许可证,可免费使用与修改,商业使用请遵守许可证条款(例如保留版权声明与许可声明)。

如何获取 sweet-alert 的源码?

可以直接克隆仓库:git clone https://github.com/realrashid/sweet-alert.git,默认分支为 main;安装与运行步骤见仓库 README。

sweet-alert 最近还在维护吗?

仓库最近一次更新为 3 周前,当前有 9 个未关闭 Issue;Star 数为 1.2k,可作为社区活跃度的参考。

关于

GitHub 原始描述(英文)

A BEAUTIFUL, RESPONSIVE, CUSTOMIZABLE, ACCESSIBLE (WAI-ARIA) REPLACEMENT FOR JAVASCRIPT'S POPUP BOXES FOR LARAVEL

描述取自 GitHub 官方 API,保持仓库作者书写的原文。

简要分析

热度分
1518
价值分
746
活跃状态
活跃

语言占比

Blade
JavaScript
PHP

Release

README

Laravel SweetAlert

A beautiful, responsive, customizable, accessible (WAI-ARIA) replacement for JavaScript popup boxes for Laravel — rebuilt from scratch with a fluent, Laravel-native API.

Latest Version on Packagist GitHub Tests Action Status Total Downloads

Features

  • Fluent Builder API — Chain methods naturally like Laravel Eloquent
  • Full SweetAlert2 Coverage — Inputs, deny buttons, pre-confirm, animations, themes, and more
  • Three Purpose-Built Builders — AlertBuilder, ToastBuilder, and InputBuilder
  • PHP 8.3+ Enums — Type-safe AlertType, InputType, and Position enums with IDE autocompletion
  • Livewire v4 Support — First-class SweetAlertTrait for dispatching alerts as browser events
  • Inertia.js Support — Share alerts with Vue/React via the included middleware
  • Guarded Actions — data-confirm asks before any link or form goes through, no JavaScript to write
  • Laravel Boost Ready — ships a guideline and skill so AI assistants write v8 code, not v7
  • Guided Upgrade — php artisan alert:upgrade migrates a v7 codebase for you, with --dry-run

See It Running

AlertDeck is a Laravel app that exercises every alert this package can produce — in Blade, in Livewire and in Inertia, plus the guarded-action attributes, all seven themes, and routes migrated from v7 by alert:upgrade.

Quick Start

composer require realrashid/sweet-alert
php artisan alert:install

Upgrading from v7? See what would change before anything is written:

php artisan alert:upgrade --dry-run

Add the Blade directive to your layout:

<head>
    ...
</head>
<body>
    ...
    @sweetAlert
</body>

Fire an alert from any controller:

use RealRashid\SweetAlert\Facades\Alert;

Alert::title('Welcome!')
    ->success()
    ->text('Your account has been created.')
    ->flash();

return redirect()->route('dashboard');

Or use the global helper:

alert('Success!', 'Your data has been saved.', 'success');

return redirect()->back();

Documentation

Ready to explore all the features and options? Dive into our comprehensive documentation:

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

If you discover a security vulnerability, please help us maintain the security of this project by responsibly disclosing it to us. To report a security vulnerability, please send an email to [email protected]. We’ll address the issue as promptly as possible.

Credits

Support My Work

If you find Laravel SweetAlert helpful and would like to support my work, you can buy me a coffee. Your support will help keep this project alive and thriving. It’s a small token of appreciation that goes a long way.

Buy me a coffee

License

The MIT License (MIT). Please see License File for more information.

Made with ❤️ from Pakistan

评论

暂无评论