承接 ez-laravel/flash-messages 相关项目开发

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

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

ez-laravel/flash-messages

Composer 安装命令:

composer require ez-laravel/flash-messages

包简介

Easy flash messages for your Laravel application.

README 文档

README

Build Status StyleCI

Package to provide you with an easy way to implement flash messages in your Laravel application.

Installation

Run the following command in your project directory to install the package:

composer require ez-laravel/flash-messages

Publish the vue components using the following commands:

php artisan vendor:publish --provider=EZ\FlashMessages\FlashServiceProvider --tag=vue

This will publish a flash-messages directory in your resources/js/components directory.

Make sure these components are (auto) loaded in. I usually make this happen using:

// app.js

// Automatically load all vue components
const files = require.context('./', true, /\.vue$/i);
files.keys().map(key => Vue.component(key.split('/').pop().split('.')[0], files(key).default));

To be able to render the 'important' icon this package makes use of Font Awesome icons so make sure that's loaded if you intend to use the 'important' status

Usage

Use the following blade directive to include the flash messages partial in any view you'd like to display flash messages in

@include("flash::messages")

Afterwards you can call the following methods from your controller to flash messages to the session which will be displayed on the next page load.

// Message with level 'info'
flash('Your message');

// Message with level 'success'
flash('Your message')->success();

// Message with level 'error'
flash('Your message')->error();

// Message with level 'warning'
flash('Your message')->warning();

// Overlay (modal) with default title and custom message
flash('Your message')->overlay();

// Overlay (modal) with custom title and message
flash()->overlay('Your message', 'Your title');

// Message with level 'info' which is important (so it gets a warning icon)
flash('Your message')->important();

Flash message partial

If you'd like to customize the flash message partial you can publish it using the following command:

php artisan vendor:publish --provider=EZ\FlashMessages\FlashServiceProvider --tag=views

This will publish the partial to the resources/views/vendor/flash directory.

Customize styling

All styling is defined inside of the vue components you've published.

To do

  • Add an option to automatically hide the flash message after X seconds

Credits

This package was basically copied from laracasts/flash as a practice project. I used to use that package a lot and this one is custom tailored to how I like to use it. So big thank you to laracasts for the code and all lessons provided by their platform.

ez-laravel/flash-messages 适用场景与选型建议

ez-laravel/flash-messages 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 2.08k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2020 年 06 月 20 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 ez-laravel/flash-messages 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 ez-laravel/flash-messages 我们能提供哪些服务?
定制开发 / 二次开发

基于 ez-laravel/flash-messages 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

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

其他信息

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