PHPackages                             standaniels/flash - 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. standaniels/flash

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

standaniels/flash
=================

Easy flash notifications

3.0.2(9y ago)63.0k3MITPHPPHP &gt;=5.6.0

Since Jun 30Pushed 9y ago2 watchersCompare

[ Source](https://github.com/standaniels/flash)[ Packagist](https://packagist.org/packages/standaniels/flash)[ RSS](/packages/standaniels-flash/feed)WikiDiscussions master Synced 4w ago

READMEChangelogDependencies (2)Versions (15)Used By (0)

Easy Flash Messages for Your Laravel App
========================================

[](#easy-flash-messages-for-your-laravel-app)

*Forked from laracasts/flash to add support for multiple notifications.*

[![Build Status](https://camo.githubusercontent.com/839b5733efd49672a518572e79b08bc2e21ab4407091392d6a557029c4f19dd1/68747470733a2f2f7472617669732d63692e6f72672f7374616e64616e69656c732f666c6173682e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/standaniels/flash)

Installation
------------

[](#installation)

First, pull in the package through Composer.

Run `composer require standaniels/flash`

And then, if using Laravel 5, include the service provider within `config/app.php`.

```
'providers' => [
    StanDaniels\Flash\FlashServiceProvider::class,
];
```

Usage
-----

[](#usage)

Within your controllers, before you perform a redirect...

```
public function store()
{
    flash('Welcome Aboard!');

    return home();
}
```

You may also do:

- `flash('Message', 'info')`
- `flash('Message', 'success')`
- `flash('Message', 'danger')`
- `flash('Message', 'warning')`
- `flash()->overlay('Modal Message', 'Modal Title')`
- `flash('Message')->important()`

Behind the scenes, this will set a `flash_notifications` key which contains an array of messages. Every messages is an instance of `Illuminate\Support\Collection`:

- 'message' - The message you're flashing
- 'level' - A string that represents the type of notification (good for applying HTML class names)

With this message flashed to the session, you may now display it in your view(s). Maybe something like:

```
@foreach (flash()->all() as $message)

        &times;

        {!! $message->get('message') !!}

@endforeach
```

> Note that this package is optimized for use with Twitter Bootstrap.

Because flash messages and overlays are so common, if you want, you may use (or modify) the views that are included with this package. Simply append to your layout view:

```
@include('flash::messages')
```

Example
-------

[](#example)

```
>

    Document

    @include('flash::messages')

    Welcome to my website...

    $('.flash-modal').modal();

```

If you need to modify the flash message partials, you can run:

```
php artisan vendor:publish
```

The two package views will now be located in the `app/views/packages/standaniels/flash/` directory.

```
flash('Welcome Aboard!');

return home();
```

[![https://dl.dropboxusercontent.com/u/774859/GitHub-Repos/flash/message.png](https://camo.githubusercontent.com/ea8b3221a5ac8f1dd24ce31888dfb406fb500576b08f27cdd947f0f363e0eaad/68747470733a2f2f646c2e64726f70626f7875736572636f6e74656e742e636f6d2f752f3737343835392f4769744875622d5265706f732f666c6173682f6d6573736167652e706e67)](https://camo.githubusercontent.com/ea8b3221a5ac8f1dd24ce31888dfb406fb500576b08f27cdd947f0f363e0eaad/68747470733a2f2f646c2e64726f70626f7875736572636f6e74656e742e636f6d2f752f3737343835392f4769744875622d5265706f732f666c6173682f6d6573736167652e706e67)

```
flash('Sorry! Please try again.', 'danger');

return home();
```

[![https://dl.dropboxusercontent.com/u/774859/GitHub-Repos/flash/error.png](https://camo.githubusercontent.com/f772165d97c60686d8bc5279dde14eebb2e570d333f4721b975928bf722405ba/68747470733a2f2f646c2e64726f70626f7875736572636f6e74656e742e636f6d2f752f3737343835392f4769744875622d5265706f732f666c6173682f6572726f722e706e67)](https://camo.githubusercontent.com/f772165d97c60686d8bc5279dde14eebb2e570d333f4721b975928bf722405ba/68747470733a2f2f646c2e64726f70626f7875736572636f6e74656e742e636f6d2f752f3737343835392f4769744875622d5265706f732f666c6173682f6572726f722e706e67)

```
flash()->overlay('Notice', 'You are now a VIP!');

return home();
```

[![https://dl.dropboxusercontent.com/u/774859/GitHub-Repos/flash/overlay.png](https://camo.githubusercontent.com/97b6fa964c2ff2a81eb3142d61137101cfe4bdb6f6dcbde8c094e604b451b540/68747470733a2f2f646c2e64726f70626f7875736572636f6e74656e742e636f6d2f752f3737343835392f4769744875622d5265706f732f666c6173682f6f7665726c61792e706e67)](https://camo.githubusercontent.com/97b6fa964c2ff2a81eb3142d61137101cfe4bdb6f6dcbde8c094e604b451b540/68747470733a2f2f646c2e64726f70626f7875736572636f6e74656e742e636f6d2f752f3737343835392f4769744875622d5265706f732f666c6173682f6f7665726c61792e706e67)

Hiding Flash Messages
---------------------

[](#hiding-flash-messages)

A common desire is to display a flash message for a few seconds, and then hide it. To handle this, write a simple bit of JavaScript. For example, using jQuery, you might add the following snippet just before the closing `` tag.

```

$('div.alert').not('.alert-important').delay(3000).fadeOut(350);

```

This will find any alerts - excluding the important ones, which should remain until manually closed by the user - wait three seconds, and then fade them out.

Credits
-------

[](#credits)

Special thanks to Jeffrey Way's laracasts/flash.

###  Health Score

35

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community22

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 51.6% 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 ~84 days

Recently: every ~98 days

Total

13

Last Release

3368d ago

Major Versions

1.3.4 → 2.0.02016-03-14

2.0.1 → 3.0.02016-11-15

PHP version history (2 changes)1.0PHP &gt;=5.4.0

3.0.2PHP &gt;=5.6.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/e323e86ae4be21fd808f892fe4292a5708a1fdb42bcdeceefa9e6a42b1bbf967?d=identicon)[standaniels](/maintainers/standaniels)

---

Top Contributors

[![JeffreyWay](https://avatars.githubusercontent.com/u/183223?v=4)](https://github.com/JeffreyWay "JeffreyWay (33 commits)")[![INOVAdev-joost](https://avatars.githubusercontent.com/u/4394706?v=4)](https://github.com/INOVAdev-joost "INOVAdev-joost (3 commits)")[![standaniels](https://avatars.githubusercontent.com/u/1199737?v=4)](https://github.com/standaniels "standaniels (3 commits)")[![shaneparsons](https://avatars.githubusercontent.com/u/5495493?v=4)](https://github.com/shaneparsons "shaneparsons (3 commits)")[![zablose](https://avatars.githubusercontent.com/u/8734335?v=4)](https://github.com/zablose "zablose (2 commits)")[![LordMilutin](https://avatars.githubusercontent.com/u/76582100?v=4)](https://github.com/LordMilutin "LordMilutin (2 commits)")[![quickliketurtle](https://avatars.githubusercontent.com/u/1762128?v=4)](https://github.com/quickliketurtle "quickliketurtle (2 commits)")[![chaot1xMD](https://avatars.githubusercontent.com/u/36856151?v=4)](https://github.com/chaot1xMD "chaot1xMD (2 commits)")[![Schnoop](https://avatars.githubusercontent.com/u/1263407?v=4)](https://github.com/Schnoop "Schnoop (1 commits)")[![sergiogregorutti](https://avatars.githubusercontent.com/u/3071996?v=4)](https://github.com/sergiogregorutti "sergiogregorutti (1 commits)")[![therouv](https://avatars.githubusercontent.com/u/393419?v=4)](https://github.com/therouv "therouv (1 commits)")[![thoresuenert](https://avatars.githubusercontent.com/u/382395?v=4)](https://github.com/thoresuenert "thoresuenert (1 commits)")[![vinkla](https://avatars.githubusercontent.com/u/499192?v=4)](https://github.com/vinkla "vinkla (1 commits)")[![waiyan112](https://avatars.githubusercontent.com/u/3263761?v=4)](https://github.com/waiyan112 "waiyan112 (1 commits)")[![ludo237](https://avatars.githubusercontent.com/u/921500?v=4)](https://github.com/ludo237 "ludo237 (1 commits)")[![codeclown](https://avatars.githubusercontent.com/u/211543?v=4)](https://github.com/codeclown "codeclown (1 commits)")[![freekmurze](https://avatars.githubusercontent.com/u/483853?v=4)](https://github.com/freekmurze "freekmurze (1 commits)")[![h4cc](https://avatars.githubusercontent.com/u/2981491?v=4)](https://github.com/h4cc "h4cc (1 commits)")[![hpakdaman](https://avatars.githubusercontent.com/u/9606809?v=4)](https://github.com/hpakdaman "hpakdaman (1 commits)")[![imknight](https://avatars.githubusercontent.com/u/77604?v=4)](https://github.com/imknight "imknight (1 commits)")

### Embed Badge

![Health badge](/badges/standaniels-flash/health.svg)

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

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M342](/packages/psalm-plugin-laravel)[renatomarinho/laravel-page-speed

Laravel Page Speed

2.5k1.7M11](/packages/renatomarinho-laravel-page-speed)[illuminate/pagination

The Illuminate Pagination package.

12234.1M1.0k](/packages/illuminate-pagination)[illuminate/pipeline

The Illuminate Pipeline package.

9349.2M275](/packages/illuminate-pipeline)[illuminate/broadcasting

The Illuminate Broadcasting package.

7127.2M208](/packages/illuminate-broadcasting)[illuminate/redis

The Illuminate Redis package.

9014.6M369](/packages/illuminate-redis)

PHPackages © 2026

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