PHPackages                             laravelchen/myflash - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. laravelchen/myflash

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

laravelchen/myflash
===================

cool flash

1.3(9y ago)379676MITHTML

Since Mar 12Pushed 9y ago2 watchersCompare

[ Source](https://github.com/LaravelChen/myflash)[ Packagist](https://packagist.org/packages/laravelchen/myflash)[ RSS](/packages/laravelchen-myflash/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (1)Versions (5)Used By (0)

Flash Message For Laravel5
==========================

[](#flash-message-for-laravel5)

介绍
--

[](#介绍)

> 整个package采用了Laravel内置的`Illuminate\Session\Store`中的一次性请求flash函数. 显示视图的方式有三种，图中可以看到.(**安装的时候最好开启vpn,因为给有人反映国内镜像好像安装不了,所以说用国外的composer的镜像吧!**)

效果图
---

[](#效果图)

[![image](https://github.com/LaravelChen/myflash/raw/master/images/example.png)](https://github.com/LaravelChen/myflash/raw/master/images/example.png)

安装
--

[](#安装)

#### 使用composer安装

[](#使用composer安装)

```
composer require laravelchen/myflash

```

#### 然后在`config/app.php`添加provider和alias

[](#然后在configappphp添加provider和alias)

```
'providers' => [
   LaravelChen\MyFlash\MyFlashProvider::class,
   ];

```

```
'aliases' => [
    'MyFlash'=>LaravelChen\MyFlash\MyFlash::class,
];

```

用法
--

[](#用法)

#### 在redirect重定向之前添加falsh

[](#在redirect重定向之前添加falsh)

```
public function index()
{
    MyFlash::success('邮件已发!请查收邮件!');

    return Redirect::home();
}

```

#### 同时你也可以使用下面这种形式

[](#同时你也可以使用下面这种形式)

- MyFlash::success('邮件已发!请查收邮件!')
- MyFlash::info('邮件已发!请查收邮件!')
- MyFlash::error('邮件已发!请查收邮件!')
- MyFlash::warning('邮件已发!请查收邮件!')

#### 或者你可以使用`myflash()`这种辅助函数的形式

[](#或者你可以使用myflash这种辅助函数的形式)

- myflash('邮件已发!请查收邮件!')
- myflash()-&gt;success('邮件已发!请查收邮件!')
- myflash()-&gt;info('邮件已发!请查收邮件!')
- myflash()-&gt;error('邮件已发!请查收邮件!')
- myflash()-&gt;warning('邮件已发!请查收邮件!')

#### 最后在你的视图中添加`message`视图

[](#最后在你的视图中添加message视图)

```
@include('myflash::notification')
或者
@include('myflash::top-message')
或者
@include('myflash::bottom-message')

```

注意事项
----

[](#注意事项)

#### 请在你的视图中增加font-awesome和jquery

[](#请在你的视图中增加font-awesome和jquery)

```

```

例子
--

[](#例子)

```

    Laravel

Hello World

@include('myflash::notification')

```

自定义
---

[](#自定义)

#### 如果你想要自定义样式或者其他效果的话可以使用

[](#如果你想要自定义样式或者其他效果的话可以使用)

```
php artisan vendor:publish

```

##### 之后视图文件会出现在你的`resources/views/vendor/myflash`目录下

[](#之后视图文件会出现在你的resourcesviewsvendormyflash目录下)

> 最后感谢mercuryseries和Jeffrey Way的package!

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity26

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

4

Last Release

3350d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/56259cc9d85917300c3993a5b19002a0453ddfff15f305efd5e69606eec57115?d=identicon)[LaravelChen](/maintainers/LaravelChen)

---

Top Contributors

[![LaravelChen](https://avatars.githubusercontent.com/u/16264254?v=4)](https://github.com/LaravelChen "LaravelChen (14 commits)")

---

Tags

flashlaravelphp

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/laravelchen-myflash/health.svg)

```
[![Health](https://phpackages.com/badges/laravelchen-myflash/health.svg)](https://phpackages.com/packages/laravelchen-myflash)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
