PHPackages                             xuzh/toastr\_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. [Mail &amp; Notifications](/categories/mail)
4. /
5. xuzh/toastr\_flash

ActiveLibrary[Mail &amp; Notifications](/categories/mail)

xuzh/toastr\_flash
==================

Bootstrap and toastr Easy flash notifications

2.0.2(10y ago)016MITPHP &gt;=5.4.0

Since Jun 30Compare

[ Source](https://github.com/xuzh86/flash)[ Packagist](https://packagist.org/packages/xuzh/toastr_flash)[ RSS](/packages/xuzh-toastr-flash/feed)WikiDiscussions Synced today

READMEChangelog (2)Dependencies (2)Versions (12)Used By (0)

Easy Flash Messages
===================

[](#easy-flash-messages)

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

[](#installation)

First, pull in the package through Composer.

Run `composer require xuzh/toastr_flash`

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

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

And, for convenience, add a facade alias to this same file at the bottom:

```
'aliases' => [
    'Flash' => Laracasts\Flash\Flash:class,
];
```

Usage
-----

[](#usage)

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

```
public function store()
{
    Flash::message('Welcome Aboard!');

    return Redirect::home();
}
```

You may also do:

- `Flash::info('Message')`
- `Flash::success('Message')`
- `Flash::error('Message')`
- `Flash::warning('Message')`
- `Flash::overlay('Modal Message', 'Modal Title')`

Again, if using Laravel, this will set a few keys in the session:

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

Alternatively, again, if you're using Laravel, you may reference the `flash()` helper function, instead of the facade. Here's an example:

```
/**
 * Destroy the user's session (logout).
 *
 * @return Response
 */
public function destroy()
{
    Auth::logout();

    flash()->success('You have been logged out.');

    return home();
}
```

Or, for a general information flash, just do: `flash('Some message');`.

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

```
@if (Session::has('flash_notification.message'))

        &times;

        {{ Session::get('flash_notification.message') }}

@endif
```

> 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::message')
```

Example
-------

[](#example)

```
>

    Document

    @include('flash::message')

    Welcome to my website...

    $('#flash-overlay-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/laracasts/flash/` directory.

```
Flash::message('Welcome aboard!');

return Redirect::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::error('Sorry! Please try again.');

return Redirect::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('You are now a Laracasts member!');

return Redirect::home();
```

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

> [Learn exactly how to build this very package on Laracasts!](https://laracasts.com/lessons/flexible-flash-messages)

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity65

Established project with proven stability

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 ~71 days

Recently: every ~125 days

Total

11

Last Release

3666d ago

Major Versions

1.3.4 → 2.0.02016-03-14

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/6984571?v=4)[xuzh](/maintainers/xuzh86)[@xuzh86](https://github.com/xuzh86)

### Embed Badge

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

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

###  Alternatives

[propaganistas/laravel-disposable-email

Disposable email validator

6012.9M7](/packages/propaganistas-laravel-disposable-email)[illuminate/mail

The Illuminate Mail package.

5910.4M475](/packages/illuminate-mail)[laravel-notification-channels/apn

Apple APN Push Notification Channel

2022.1M6](/packages/laravel-notification-channels-apn)[illuminate/notifications

The Illuminate Notifications package.

483.0M1.1k](/packages/illuminate-notifications)[erag/laravel-disposable-email

A Laravel package to detect and block disposable email addresses.

252143.0k](/packages/erag-laravel-disposable-email)

PHPackages © 2026

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