承接 helmesvs/laravel-notify 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

helmesvs/laravel-notify

最新稳定版本:v1.1.0

Composer 安装命令:

composer require helmesvs/laravel-notify

包简介

Elegant notifications to laravel with Toastr or PNotify

README 文档

README

Elegant notifications to laravel with Toastr or PNotify

alt text

Installation

  1. Either run composer require helmesvs/laravel-notify or add "helmesvs/laravel-notify" to the require key in composer.json and run composer install.
  2. Add Helmesvs\Notify\NotifyServiceProvider::class, to the providers key in config/app.php.
  3. Add 'Notify' => Helmesvs\Notify\Facades\Notify::class, to the aliases key in config/app.php.
  4. Run php artisan vendor:publish --provider="Helmesvs\Notify\NotifyServiceProvider" --tag="notify" to publish the config file.
  5. Include the output {!! Notify::render() !!} in your master view template.
  6. Optional: Modify the configuration file located in config/notify.php.

Usage

Call one of these methods in your controllers to insert a notification:

  • Notify::warning($message, $title = null, $options = []) - add a warning notification
  • Notify::error($message, $title = null, $options = []) - add an error notification
  • Notify::info($message, $title = null, $options = []) - add an info notification
  • Notify::success($message, $title = null, $options = []) - add a success notification
  • Notify::add($type: warning|error|info|success, $message, $title = null, $options = []) - add a notification
  • Notify::clear() - clear all current notification

Configuration

Open config/notify.php to adjust package configuration. If this file doesn't exist, run php artisan vendor:publish --provider="Helmesvs\Notify\NotifyServiceProvider" --tag="notify" to create the default configuration file.

General Options

'options' => [
        'lib' => 'toastr',
        'style' => 'custom'
]

Set 'lib' as toastr to use toastr.js or pnotify to use pnotify.js.

Set 'style' to 'custom' to use custom settings, or as 'default' to default library settings.

The style of notifications can be customized in public/vendor/Notify/style.css.

Options Toastr

'ToastrOptions' => [
        "closeButton" => false,
        "closeHtml" => '',
        "newestOnTop" => true,
        "progressBar" => false,
        ...
]

Options PNotify

'PNotifyOptions' => [
        'title_escape' => false,
        'text_escape' => false,
        'styling' => 'brighttheme',
        'addclass' => '', 
        ...
]

For a list of available options, see toastr.js' documentation and pnotify.js' documentation.

统计信息

  • 总下载量: 26.96k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 61
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 61
  • Watchers: 6
  • Forks: 11
  • 开发语言: CSS

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-09-28