orus/flash
Composer 安装命令:
composer require orus/flash
包简介
A simple php and laravel flash alert package.
README 文档
README
this package gives you a simple way to manage alerts into your laravel project. It also works with any php project.
Installation
Include the package in your project using composer.
composer require orus/flash
If you're using a version of laravel prior to 5.5 you need you to include te service provider and the alias in your config/app.php.
"providers" => [ ... Orus\Flash\Providers\FlashServiceProvider::class, ], "aliases" => [ ... "Flash" => Orus\Flash\Facades\Flash::class ]
Usage
Before performing your redirect, you can call the flash() helper function.
Route::post("/login", function() { flash("welcome in the matrix"); return redirect("/profile"); }
You can specify the alert type by using the fluent api it offers.
flash(); // Flash object. flash()->default("message") // A default flash alert flash()->danger("message") // A danger flash alert flash()->warning("message") // A warning flash alert flash()->info("message") // An info flash alert flash()->success("message") // A success flash alert flash()->default("message")->title("Default") // Set the alert title flash()->danger("message")->important() // Set the alert as important flash()->info("message")->options(["key"] => "value") // Add options to the alert flash("message")->success(); // Or define your message and set the type. flash()->info("message")->success("message"); // You can chain multiple alerts.
It also gives you the ability to set multiple flash alerts.
Route::post("/login", function() { flash("welcome in the matrix")->default(); flash("May the code be with you!")->info(); return redirect("/profile"); }
Then you can get a collection of the alerts in your views.
{{ flash()->all() }}
orus/flash 适用场景与选型建议
orus/flash 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 300 次下载、GitHub Stars 达 0, 最近一次更新时间为 2017 年 07 月 17 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「php」 「notifications」 「flash」 「laravel」 「alert」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 orus/flash 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 orus/flash 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 orus/flash 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A Laravel Nova package that adds a notification feed in your Nova app.
Notification component for storing and retrieving flash data.
Shim repository for WebcamJS
Captures outgoing SMS notifications
A modern take on PHP session-based flash messages
A Laravel package made for displaying flashes messages in a conveniant way
统计信息
- 总下载量: 300
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 8
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-07-17