nicoaudy/noty 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

nicoaudy/noty

Composer 安装命令:

composer require nicoaudy/noty

包简介

Elegant Flash Message Wrapper For Laravel

README 文档

README

License Latest Version on Packagist Total Downloads

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.

Screenshot

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.

统计信息

  • 总下载量: 990
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 3
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 3
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-07-15

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固