定制 bpocallaghan/notify 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

bpocallaghan/notify

最新稳定版本:3.0.1

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 icon
  • notify()->info('Title', 'Description', 'smile-o'); // specify the icon class
  • notify()->message($level = 'info', $title, $content, $icon, $timeout = 5000) // arguments
  • notify()->message('info', 'Title', 'Description', 'smile-o'); // specify the type of level
  • notify()->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

统计信息

  • 总下载量: 15.18k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 34
  • 点击次数: 2
  • 依赖项目数: 4
  • 推荐数: 0

GitHub 信息

  • Stars: 33
  • Watchers: 5
  • Forks: 13
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-04-03