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

ActiveLibrary

mwa/flash
=========

Flash notifications

1.1(9y ago)017PHPPHP &gt;=5.4.0

Since Jun 1Pushed 9y ago1 watchersCompare

[ Source](https://github.com/khaledelmahdi/flash)[ Packagist](https://packagist.org/packages/mwa/flash)[ RSS](/packages/mwa-flash/feed)WikiDiscussions master Synced 1mo ago

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

Flash Messages
==============

[](#flash-messages)

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

[](#installation)

First, pull in the package through Composer.

Run `composer require mwa/flash`

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

```
'providers' => [
    'MWA\Flash\FlashServiceProvider'
];
```

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

```
'aliases' => [
    'Flash' => 'MWA\Flash\Flash'
];
```

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/mwa/flash/` directory.

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

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

Total

2

Last Release

3623d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/85315fb8a70e823df8ec1e9a7aa7834daa8e6ccc553a72c92ea0a89e54d04f02?d=identicon)[KhaledElmahdi](/maintainers/KhaledElmahdi)

### Embed Badge

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

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

###  Alternatives

[fumeapp/modeltyper

Generate TypeScript interfaces from Laravel Models

196277.9k](/packages/fumeapp-modeltyper)[slowlyo/owl-admin

基于 laravel、amis 开发的后台框架~

61214.2k26](/packages/slowlyo-owl-admin)

PHPackages © 2026

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