nicoaudy/noty
Composer 安装命令:
composer require nicoaudy/noty
包简介
Elegant Flash Message Wrapper For Laravel
README 文档
README
This is a elegant and configurable notify package to send flash messages in Laravel apps. A flash message is a message that is carried over to the next request by storing it in the session.
This is how it can be used:
Installation
You can install the package via composer:
composer require nicoaudy/noty
You can publish the config file with:
php artisan vendor:publish --provider="Nicoaudy\Noty\NotyServiceProvider"
This is the contents of the published config file:
return [ /* * Title configuration color */ 'titleColor' => '', /* * Title configuration size */ 'titleSize' => '', /* * Title configuration line hight */ 'titleLineHeight' => '', /* * Message configuration color */ 'messageColor' => '', /* * Message configuration size */ 'messageSize' => '', /* * Message configuration line hight */ 'messageLineHeight' => '', /* * Positions: bottomRight, bottomLeft, topRight, topLeft, topCenter, bottomCenter, center */ 'position' => 'topRight', /* * Themes: light, dark */ 'theme' => 'light', /* * Layout: 1 (title inline with message), 2 (title on top of message) */ 'layout' => 1, /* * [integer|boolean] - Delay for closing event in milliseconds. Set false for sticky notifications. */ 'timeout' => 4000, /* * [boolean] - Displays a progress bar. */ 'progressBar' => true, /* * [string] - Progress bar color */ 'progressBarColor' => 'rgb(0, 255, 184)', /* * [string] - Progress bar linear / ease */ 'progressBarEasing' => 'linear', /* * [boolean] - Balloon */ 'balloon' => true, /* * [boolean] - enable to close? */ 'close' => true, /* * [boolean] - Close on click */ 'closeOnClick' => false, /* * [boolean] - Close on escape? */ 'closeOnEscape' => false, /* * Animate inside */ 'animateInside' => true, // bool /* * Enable drag for close */ 'drag' => true, // bool /* * Pause on hover */ 'pauseOnHover' => true, // bool /* * Reset on hover */ 'resetOnHover' => false, // bool /* * [string] - Transition In * Default toast open animation. It can be: bounceInLeft, bounceInRight, bounceInUp, bounceInDown, fadeIn, fadeInDown, fadeInUp, fadeInLeft, fadeInRight or flipInX. */ 'transitionIn' => 'fadeInUp', /* * [string] - Transition Out * Default toast close animation. It can be: fadeOut, fadeOutUp, fadeOutDown, fadeOutLeft, fadeOutRight, flipOutX */ 'transitionOut' => 'fadeOut', /* * [string] - Transition In Mobile */ 'transitionInMobile' => 'fadeInUp', /* * [string] - Transition Out Mobile */ 'transitionOutMobile' => 'fadeOutDown', ];
Because flash messages are so common, we provide a template out of the box to get you started. Place this before end of the body tag.
{{ noty_assets() }}
</body>
Usage
Within your controllers, before you perform a redirect, make a call to the noty() function.
public function store() { noty()->flash('Cool', 'Your data has been saved'); return home(); }
You may also do:
noty()->flash('Hey!', 'This is message'); noty()->info('Hey!', 'This is message'); noty()->success('Hey!', 'This is message'); noty()->warning('Hey!', 'This is message'); noty()->danger('Hey!', 'This is message');
With this message flashed to the session, you may now display it in your view(s).
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email nico.audi@intidata.net instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.
nicoaudy/noty 适用场景与选型建议
nicoaudy/noty 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 990 次下载、GitHub Stars 达 3, 最近一次更新时间为 2020 年 07 月 15 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「noty」 「nicoaudy」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 nicoaudy/noty 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 nicoaudy/noty 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 nicoaudy/noty 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Notifications for your Yii2 app
Laravel Laravel Package for beautifull JS notification.
Noty notification package for Laravel
Notifiaction in yii2
Noty3 widget for Yii2
a laravel package for creating toast
统计信息
- 总下载量: 990
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 3
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-07-15
