承接 gnahotelsolutions/flasher 相关项目开发

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

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

gnahotelsolutions/flasher

Composer 安装命令:

composer require gnahotelsolutions/flasher

包简介

Flash notifications in Laravel

README 文档

README

Latest Version on Packagist Total Downloads Software License

The gnahotelsolutions/flasher package provides an easy way to interact with flashed messages in your Laravel application.

Install

You can install the package via composer:

$ composer require gnahotelsolutions/flasher

Usage

The messages are stored in the notifications session key.

All notifications have a default duration property set to 5 seconds. You can use this property in your JavaScript to make notifications disappear automatically.

Creating notifications

Flasher::info("Welcome, {$user->name}");

Flasher::error('Incorrect password');

Flasher::warning('Remember to change your password');

Flasher::success('Password changed!');

If you want to use custom types, you can use the method createNotification

Flasher::createNotification('store', 'Someone bought a product!', null);

Check if there are pending notifications

@if (Flasher::any())
    <div class="alerts">
        ...
    </div>
@endif

Iterating over notifications

@foreach(Flasher::all() as $notification)
    <div class="alert alert-{{ $notification->getType() }}" data-duration="{{ $notification->getDuration() }}">
        {{ $notification->getMessage() }}
    </div> 
@endforeach

If you're using Bootstrap in your project, you can use getBootstrapClass() method. It will replace error with danger to match the framework's CSS class.

Testing

phpunit

Security

If you discover any security related issues, please email dllop@gna.es instead of using the issue tracker.

License

The MIT License (MIT).

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-06-06

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固