定制 howlowck/one-message 二次开发

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

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

howlowck/one-message

Composer 安装命令:

composer require howlowck/one-message

包简介

Laravel Package for managing messages

README 文档

README

For Easy Management of Messages in One singleton. Anywhere in the process you want to add a message just add it in the singleton and in the view just use it to display your messages.

Feature:

  1. Handles Flash or Same-Request Messages
  2. Handles Validation Messages
  3. Easy API

Setup:

in app/config/app.php

  • Add Service provider add 'Howlowck\OneMessage\OneMessageServiceProvider' in providers array

  • Add Facade add 'OneMessage' => 'Howlowck\OneMessage\Facades\OneMessage' in aliases array

Usage:

There are three type of messages: Error, Success, and Info.

Add Message

OneMessage::addError(['authorization' => 'You are unauthorized!!!']);

or you can throw a MessageBag in there

$v = Validator::make($data, $rules);
if ($v->fails()) {
	OneMessage::addError($v->errors());
}

Add Message for Flash
When adding to the flash data, it will not be available in the current request.

OneMessage::addError(['authorization' => 'You are unauthorized!!!'], true);

get Message

OneMessage::getError();

or get a specific message with key

OneMessage::getError('authorization');

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: Unknown
  • 更新时间: 2014-01-21

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固