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

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

mintalicious/laracasts-flash
============================

Easy flash notifications

1.1.1(2y ago)0569MITPHPPHP &gt;=5.4.0

Since Mar 18Pushed 2y agoCompare

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

READMEChangelog (1)Dependencies (3)Versions (5)Used By (0)

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

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

This composer package offers a Twitter Bootstrap optimized flash messaging setup for your Laravel applications.

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

[](#installation)

Begin by pulling in the package through Composer.

```
composer require laracasts/flash
```

Next, as noted above, the default CSS classes for your flash message are optimized for Twitter Bootstrap. As such, either pull in the Bootstrap's CSS within your HTML or layout file, or write your own CSS based on these classes.

```

```

Usage
-----

[](#usage)

Within your controllers, before you perform a redirect, make a call to the `flash()` function.

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

    return home();
}
```

You may also do:

- `flash('Message')->success()`: Set the flash theme to "success".
- `flash('Message')->error()`: Set the flash theme to "danger".
- `flash('Message')->warning()`: Set the flash theme to "warning".
- `flash('Message')->overlay()`: Render the message as an overlay.
- `flash()->overlay('Modal Message', 'Modal Title')`: Display a modal overlay with a title.
- `flash('Message')->important()`: Add a close button to the flash message.
- `flash('Message')->error()->important()`: Render a "danger" flash message that must be dismissed.

With this message flashed to the session, you may now display it in your view(s). Because flash messages and overlays are so common, we provide a template out of the box to get you started. You're free to use - and even modify to your needs - this template how you see fit.

```
@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 --provider="Laracasts\Flash\FlashServiceProvider"
```

The two package views will now be located in the `resources/views/vendor/flash/` directory.

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

return home();
```

```
flash('Sorry! Please try again.')->error();

return home();
```

```
flash()->overlay('You are now a Laracasts member!', 'Yay');

return home();
```

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

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.

Multiple Flash Messages
-----------------------

[](#multiple-flash-messages)

Need to flash multiple flash messages to the session? No problem.

```
flash('Message 1');
flash('Message 2')->important();

return redirect('somewhere');
```

Done! You'll now see two flash messages upon redirect.

###  Health Score

24

↓

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity39

Early-stage or recently created project

 Bus Factor1

Top contributor holds 60.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 ~22 days

Total

3

Last Release

738d ago

### Community

Maintainers

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

---

Top Contributors

[![JeffreyWay](https://avatars.githubusercontent.com/u/183223?v=4)](https://github.com/JeffreyWay "JeffreyWay (66 commits)")[![mintalicious](https://avatars.githubusercontent.com/u/10205162?v=4)](https://github.com/mintalicious "mintalicious (5 commits)")[![shaneparsons](https://avatars.githubusercontent.com/u/5495493?v=4)](https://github.com/shaneparsons "shaneparsons (3 commits)")[![laravel-shift](https://avatars.githubusercontent.com/u/15991828?v=4)](https://github.com/laravel-shift "laravel-shift (3 commits)")[![zablose](https://avatars.githubusercontent.com/u/8734335?v=4)](https://github.com/zablose "zablose (2 commits)")[![chaot1xMD](https://avatars.githubusercontent.com/u/36856151?v=4)](https://github.com/chaot1xMD "chaot1xMD (2 commits)")[![freekmurze](https://avatars.githubusercontent.com/u/483853?v=4)](https://github.com/freekmurze "freekmurze (2 commits)")[![jpuck](https://avatars.githubusercontent.com/u/15305396?v=4)](https://github.com/jpuck "jpuck (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)")[![henriquebremenkanp](https://avatars.githubusercontent.com/u/3855603?v=4)](https://github.com/henriquebremenkanp "henriquebremenkanp (1 commits)")[![tomschlick](https://avatars.githubusercontent.com/u/70184?v=4)](https://github.com/tomschlick "tomschlick (1 commits)")[![kezadias](https://avatars.githubusercontent.com/u/5727111?v=4)](https://github.com/kezadias "kezadias (1 commits)")[![landrok](https://avatars.githubusercontent.com/u/3310446?v=4)](https://github.com/landrok "landrok (1 commits)")[![h4cc](https://avatars.githubusercontent.com/u/2981491?v=4)](https://github.com/h4cc "h4cc (1 commits)")[![vinkla](https://avatars.githubusercontent.com/u/499192?v=4)](https://github.com/vinkla "vinkla (1 commits)")[![markwalet](https://avatars.githubusercontent.com/u/11446771?v=4)](https://github.com/markwalet "markwalet (1 commits)")[![MarnuLombard](https://avatars.githubusercontent.com/u/2191786?v=4)](https://github.com/MarnuLombard "MarnuLombard (1 commits)")[![minkbear](https://avatars.githubusercontent.com/u/233714?v=4)](https://github.com/minkbear "minkbear (1 commits)")[![dbpolito](https://avatars.githubusercontent.com/u/347400?v=4)](https://github.com/dbpolito "dbpolito (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[mckenziearts/laravel-notify

Flexible flash notifications for Laravel

1.7k1.1M5](/packages/mckenziearts-laravel-notify)[s-ichikawa/laravel-sendgrid-driver

This library adds a 'sendgrid' mail driver to Laravel.

4139.3M1](/packages/s-ichikawa-laravel-sendgrid-driver)[laravel-notification-channels/apn

Apple APN Push Notification Channel

2021.9M4](/packages/laravel-notification-channels-apn)[laravel-notification-channels/microsoft-teams

A Laravel Notification Channel for Microsoft Teams

1603.0M7](/packages/laravel-notification-channels-microsoft-teams)[laravel-notification-channels/discord

Laravel notification driver for Discord.

2371.3M11](/packages/laravel-notification-channels-discord)[illuminate/mail

The Illuminate Mail package.

5910.1M391](/packages/illuminate-mail)

PHPackages © 2026

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