PHPackages                             mercuryseries/flashy-bundle - 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. mercuryseries/flashy-bundle

ActiveSymfony-bundle[Mail &amp; Notifications](/categories/mail)

mercuryseries/flashy-bundle
===========================

Easy flash notifications in Symfony

v5.1.0(4y ago)2812.1k3[3 issues](https://github.com/mercuryseries/flashy-bundle/issues)MITPHPPHP ^7.3|^8.0

Since Nov 16Pushed 4y ago4 watchersCompare

[ Source](https://github.com/mercuryseries/flashy-bundle)[ Packagist](https://packagist.org/packages/mercuryseries/flashy-bundle)[ RSS](/packages/mercuryseries-flashy-bundle/feed)WikiDiscussions master Synced yesterday

READMEChangelog (8)Dependencies (4)Versions (11)Used By (0)

Nice Flash Messages in Symfony
==============================

[](#nice-flash-messages-in-symfony)

[![Example of Error Notification](https://camo.githubusercontent.com/f4ba1afc032dd18e43140cb0e14c00f054e817e4eef43db216654ad061270e2e/68747470733a2f2f692e696d6775722e636f6d2f36556e4e736e702e706e67)](https://camo.githubusercontent.com/f4ba1afc032dd18e43140cb0e14c00f054e817e4eef43db216654ad061270e2e/68747470733a2f2f692e696d6775722e636f6d2f36556e4e736e702e706e67)

Copyright
=========

[](#copyright)

Inspired by [Jeffrey Way's Flash Package](https://github.com/laracasts/flash).

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

[](#installation)

### Video Tutorial

[](#video-tutorial)

### You like text ?

[](#you-like-text-)

1. First, use [Composer](https://getcomposer.org/) to download the library:

- For Symfony 5.3+: `composer require mercuryseries/flashy-bundle`
- For Symfony versions lower than 5.3, please use: `composer require "mercuryseries/flashy-bundle:^3.0"`

2. Then add the **MercurySeriesFlashyBundle** to your application:

In Symfony &lt; 4:

```
// app/AppKernel.php
public function registerBundles()
{
    return array(
        // ...
        new MercurySeries\FlashyBundle\MercurySeriesFlashyBundle(),
        // ...
    );
}
```

In Symfony 4 with Symfony Flex this will be done automatically for you.

Usage
-----

[](#usage)

Once the bundle is installed, you can autowire a `FlashyNotifier` into any controller:

```
// Method 1: via action arguments
public function create(FlashyNotifier $flashy)
{
    ...

    $flashy->success('Event created!', 'http://your-awesome-link.com');

    return $this->redirectToRoute('home');
}
```

```
// Method 2: via constructor
public function __construct(FlashyNotifier $flashy)
{
    $this->flashy = $flashy;
}

public function create()
{
    ...

    $this->flashy->success('Event created!', 'http://your-awesome-link.com');

    return $this->redirectToRoute('home');
}
```

You may also do:

- `$flashy->info('Welcome Aboard', 'http://your-awesome-link.com')`
- `$flashy->success('Welcome Aboard', 'http://your-awesome-link.com')`
- `$flashy->error('Uh Oh', 'http://your-awesome-link.com')`
- `$flashy->warning('Be careful!', 'http://your-awesome-link.com')`
- `$flashy->primary('Thanks for signing up!', 'http://your-awesome-link.com')`
- `$flashy->primaryDark('Thanks for signing up!', 'http://your-awesome-link.com')`
- `$flashy->muted('Can you see me?', 'http://your-awesome-link.com')`
- `$flashy->mutedDark('Can you see me?', 'http://your-awesome-link.com')`

This will set a few keys in the session:

- 'mercuryseries\_flashy\_notification.message' - The message you're flashing
- 'mercuryseries\_flashy\_notification.type' - A string that represents the type of notification (good for applying HTML class names)
- 'mercuryseries\_flashy\_notification.link' - The URL to redirect to on click

With this message flashed to the session, you may now display it in your view(s) by including the partial `@MercurySeriesFlashy/flashy.html.twig`:

Example
-------

[](#example)

```

    My Awesome Website

    Welcome to my website!

    {{ include('@MercurySeriesFlashy/flashy.html.twig') }}

```

> Note that this bundle has jQuery as dependency. It's also better to load the flashy partial before your body close tag.

If you need to modify the default flash message partial, you can create a `bundles/MercurySeriesFlashyBundle/flashy.html.twig` in your `templates` folder.

The default content of `@MercurySeriesFlashy/flashy.html.twig` is:

```
{% for message in app.flashes('mercuryseries_flashy_notification') %}

        flashy("{{ message.message }}", "{{ message.link }}");

{% endfor %}
```

Basic CSS &amp; JS for the default partial
------------------------------------------

[](#basic-css--js-for-the-default-partial)

The bundles comes with basic CSS &amp; JS for the default partial so you can get started faster. Of course you can change them, use another ones or create your own partial.

```

```

> Again, note that this bundle has jQuery as dependency.

Nice rendering
--------------

[](#nice-rendering)

For a nice rendering you may include these lines in your head:

```

```

and override the following sections of the default flashy view:

```
// public/bundles/mercuryseriesflashy/css/flashy.css
.flashy {
    font-family: "Source Sans Pro", Arial, sans-serif;
    ...
}

// templates/bundles/MercurySeriesFlashyBundle/flashy.html.twig
{% for message in app.flashes('mercuryseries_flashy_notification') %}

            speaker_notes

        flashy("{{ message.message }}", "{{ message.link }}");

{% endfor %}
```

Configuration
-------------

[](#configuration)

```
# config/packages/mercuryseries_flashy.yaml
mercuryseries_flashy:
    # The name to use as the flash message key in the session store
    flash_message_name:   mercuryseries_flashy_notification

    # The session store to use for storing flash messages
    session_store: null
```

###  Health Score

37

—

LowBetter than 81% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity35

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity69

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

Recently: every ~119 days

Total

10

Last Release

1559d ago

Major Versions

v1.0.1 → v2.0.02019-11-18

v2.1.0 → v3.0.02019-11-28

v3.0.2 → v4.0.02021-05-07

v4.0.0 → v5.0.02022-03-27

PHP version history (4 changes)v1.0.0PHP ^7.1.3

3.0.1PHP &gt;=7.1.0

v3.0.2PHP ^7.1|^8.0

v5.0.0PHP ^7.3|^8.0

### Community

Maintainers

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

---

Top Contributors

[![mercuryseries](https://avatars.githubusercontent.com/u/5163810?v=4)](https://github.com/mercuryseries "mercuryseries (29 commits)")

### Embed Badge

![Health badge](/badges/mercuryseries-flashy-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/mercuryseries-flashy-bundle/health.svg)](https://phpackages.com/packages/mercuryseries-flashy-bundle)
```

PHPackages © 2026

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