tonning/flash 问题修复 & 功能扩展

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

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

tonning/flash

最新稳定版本:1.0.0

Composer 安装命令:

composer require tonning/flash

包简介

Flash for Laravel

README 文档

README

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

This composer package offers a Tailwind optimized flash messaging setup for your Laravel applications.

Installation

You can install the package via composer:

composer require tonning/flash

You can publish the view files with:

php artisan vendor:publish --provider="Tonning\Flash\FlashServiceProvider" --tag="flash-views"

You can publish the config file with:

php artisan vendor:publish --provider="Tonning\Flash\FlashServiceProvider" --tag="flash-config"

This is the contents of the published config file:

return [
    'display_errors' => true,
];

Usage

Anywhere in your application you can added a flash notification.

use Tonning\Flash\Flash;

Flash::info('A new software update is available. See what’s new in version 2.0.4.');

flash_info

Displaying notifications

@if(flash()->hasAny())
    {!! flash() !!}
@endif

Titles

You can also provide a title to your notifications that will be displayed along with it.

use Tonning\Flash\Flash;

Flash::warning('Please confirm your email address.', 'Attention needed');

flash_warning_single

Grouping

Notifications of the same type will be grouped in an unordered list.

use Tonning\Flash\Flash;

Flash::warning('Facilisis himenaeos nullam habitasse lacus sem auctor.');
Flash::warning('Please confirm your email address.', 'Attention needed');
Flash::warning('Facilisis egestas fermentum porttitor sapien eleifend amet.');

flash_warning_multiple_grouped

Errors

This package will by default also display any validation errors.

throw ValidationException::withMessages(['Something went wrong.']);

flash_error

This can be turned of in the config file.

'display_errors' => false,

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-10-18