anselmi-dev/flashed 问题修复 & 功能扩展

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

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

anselmi-dev/flashed

Composer 安装命令:

composer require anselmi-dev/flashed

包简介

A tiny component to flash messages into Laravel session object.

README 文档

README

Latest Version on Packagist License Total Downloads

Flashed is a tiny solution to deal with the flash session in Laravel. Its aim is to keeping simple and driver based messages styling in your views, controllers, repositories, etc.

Getting started

First of all, you have to install the package through Composer running the following command in your terminal:

composer require gocanto/flashed

Once composer is done, add the package service provider in the providers array in config/app.php:

Gocanto\Flashed\FlashedServiceProvider::class,

Second of all, you will have to publish the vendor files shipped within this package. As so,

php artisan vendor:publish --tag=flashed-it

Third of all, you will have to specify the configuration option you wish to have for working with this package. So far, the package was made to work with Twitter bootstrap, but you can modify this to work with any CSS styling you might need.

After running this command, you will be able to see the partial view shipped with the packages, and the configuration file. Being the second one the most important file in order for the Flashed library to work properly.

You will find a good explanation about what each of the configuration options are about. You can take a look at them clicking on here.

How it to implement it in your controllers

You have to import he flash class, as so:

use Gocanto\Flashed\Flash;

Then, you can use its static method to create a new flash message, as so:

Flash::make()->message([
  'title' => 'Hi There!',
  'body' => 'this is the body'
]);

The title and body are optional, so you do not have to pass both to the make method. If you do not pass a title, the default one will be used instead.

Also, you will have the ability to create five different flash messages, for examples: 'primary', 'success', 'warning', 'danger' and 'info'. You only need to invoke them like so:

Flash::make('info')->message([
  'title' => 'This is a info message!',
  'body' => 'this is the body'
]);

Note: By default, the message type is danger

The view shipped out

The views included with this package can be imported like so,

@include ('vendor.flashedit.messages')

And it was created to work with the default driver which is twitter bootstrap

Contributing

Please feel free to fork this package and contribute by submitting a pull request to enhance the functionalities.

License

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

Don't forget to follow me on twitter!

Thanks!

Gustavo Ocanto. gustavoocanto@gmail.com

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-02-12

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固