bpocallaghan/notify
Composer 安装命令:
composer require bpocallaghan/notify
包简介
Laravel 5 Flash Notifications with icons and animations and with a timeout
README 文档
README
Notify alert boxes to the browser with sound and font awesome icons and give it a timeout to fly out. Works great to notify the user after a successful action (CRUD). Flash the information from Laravel or create multiple from javascript.
Want to see the current package in action, have a look at the project.
Laravel Starter Project (CMS)
Documentation, Installation, and Usage Instructions
First, pull in the package through Composer.
"require": { "bpocallaghan/notify": "3.*" }
OR
composer require bpocallaghan/notify
See the documentation for detailed installation and usage instructions.
Laravel <5.4 only (Laravel 5.5 has automatic package discovery)
Include the service provider within config\app.php.
'providers' => [ Bpocallaghan\Notify\NotifyServiceProvider::class, ];
Add a facade alias or use the globel helper function notify().
'aliases' => [ 'Notify' => Bpocallaghan\Notify\Facades\Notify::class, ];
Usage
Within any view file (preferable your master layout).
@include('notify::notify')
Within any Controller.
public function index() { // helper function - default to the 'info' notify('Title', 'Description'); // return object first notify()->info('Title', 'Description'); // via the facade Notify::info('Title', 'Description'); return view('home'); }
The different 'levels' are:
notify()->info('Title', 'Description');notify()->success('Title', 'Description');notify()->warning('Title', 'Description');notify()->error('Title', 'Description');
The different arguments:
notify()->info('Title', 'Description', false);// without the iconnotify()->info('Title', 'Description', 'smile-o');// specify the icon classnotify()->message($level = 'info', $title, $content, $icon, $timeout = 5000)// argumentsnotify()->message('info', 'Title', 'Description', 'smile-o');// specify the type of levelnotify()->message('info', 'Title', 'Description', 'smile-o', 10000);// specify the timeout
If you need to modify the view partial, you can run:
php artisan vendor:publish --provider="Bpocallaghan\Notify\NotifyServiceProvider" --tag=view
The view partial can be found here resources\views\vendor\notify\notify.blade.
You need to publish the assets.
php artisan vendor:publish --provider="Bpocallaghan\Notify\NotifyServiceProvider" --tag=public
Find the files here public\vendor\notify\.
Move the mp3s to public\sounds\.
If you use Laravel Elixir, move the css and js to your resource\assets and include them in your gulpfile.js, otherwise link to the individual files in your html header.
My other Packages
bpocallaghan/notify 适用场景与选型建议
bpocallaghan/notify 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 18.46k 次下载、GitHub Stars 达 33, 最近一次更新时间为 2015 年 04 月 03 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「bootstrap」 「notifications」 「flash」 「laravel」 「notify」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 bpocallaghan/notify 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 bpocallaghan/notify 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 bpocallaghan/notify 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A Laravel Nova package that adds a notification feed in your Nova app.
Views for the package MedicOneSystems Livewire Datatables with Bootstrap 4
Notification component for storing and retrieving flash data.
bootstrap select field module implementing http://silviomoreto.github.io/bootstrap-select/
Shim repository for WebcamJS
Captures outgoing SMS notifications
统计信息
- 总下载量: 18.46k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 34
- 点击次数: 15
- 依赖项目数: 4
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-04-03