PHPackages                             gbuckingham89/laraflash - 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. gbuckingham89/laraflash

ActiveLibrary

gbuckingham89/laraflash
=======================

A package for handling flash messages / notifications in Laravel.

5.2.0(3mo ago)042.2k↑47.4%1MITPHPPHP 8.0.\*|8.1.\*|8.2.\*|8.3.\*|8.4.\*|8.5.\*

Since Jan 18Pushed 3mo ago1 watchersCompare

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

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

gbuckingham89/laraflash v5.x
============================

[](#gbuckingham89laraflash-v5x)

A simple package for handling flash messages / notifications in Laravel. Written to suit my needs - but hopefully someone else will find it useful too.

The current version requires Laravel 7.0 &amp; PHP 8.0 or greater. If you have a project that requires a lower version of PHP or Laravel, check the requirements of the older releases.

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

[](#installation)

The recommended way is using [Composer](https://getcomposer.org) - simply run this command in your terminal:

```
composer require gbuckingham89/laraflash
```

The service provider and facade will be automatically registered for you unless you have disabled auto discovery. If this is the case, you'll need to manually register the service provider and facade:

For the service provider, add the following to the `providers` array in your `app.php` config file:

```
Gbuckingham89\Laraflash\ServiceProvider::class
```

For the facade, add the following to the `aliases` array in your `app.php` config file:

```
'Laraflash' => Gbuckingham89\Laraflash\Facade\Laraflash::class
```

Finally, you'll need to publish the view file (unless you want to roll your own). Do this by running this command in your terminal:

```
php artisan vendor:publish --provider="Gbuckingham89\Laraflash\ServiceProvider"
```

Use
---

[](#use)

### Setting a message

[](#setting-a-message)

Before you redirect to another page, simply use the `Laraflash` facade to set your message. You can call the main `flash` method as follows:

```
Laraflash::flash("This is a flash message.", "success");
```

The first parameter is your message, the second is the priority level.

There are also four helper methods available for easier setting of priority levels:

```
Laraflash::success("This is a success flash message.");

Laraflash::info("This is an info flash message.");

Laraflash::warning("This is a warning flash message.");

Laraflash::danger("This is a danger flash message.");
```

### Displaying the message

[](#displaying-the-message)

To display the message, simply include the bundled view (built for Bootstrap) in your view:

```
@include('laraflash::laraflash')
```

Alternatively, you can access the data in the session directly (stored in `laraflash.message` and `laraflash.level`) and roll your own view.

### Testing Assertions

[](#testing-assertions)

This package provides `Gbuckingham89\Laraflash\LaraflashAssertions` with some basic/common assertions if you have to test that your responses contain a laraflash message, or not.

```
use Gbuckingham89\Laraflash\LaraflashAssertions;

LaraflashAssertions::assertResponseDoesntHaveLaraflash($response);

LaraflashAssertions::assertResponseHasLaraflash($response, 'info', 'The message you are expecting');

LaraflashAssertions::assertResponseHasLaraflashSuccess($response, 'The message you are expecting');
LaraflashAssertions::assertResponseHasLaraflashInfo($response, 'The message you are expecting');
LaraflashAssertions::assertResponseHasLaraflashWarning($response, 'The message you are expecting');
LaraflashAssertions::assertResponseHasLaraflashDanger($response, 'The message you are expecting');
```

Copyright and license
---------------------

[](#copyright-and-license)

Code and documentation copyright [George Buckingham](https://www.georgebuckingham.com).

Code released under the [MIT License](https://github.com/gbuckingham89/laraflash/blob/master/LICENSE).

###  Health Score

57

—

FairBetter than 98% of packages

Maintenance79

Regular maintenance activity

Popularity29

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity90

Battle-tested with a long release history

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

Recently: every ~169 days

Total

19

Last Release

109d ago

Major Versions

1.1.1 → 2.0.02019-05-12

2.0.0 → 3.0.02019-09-04

3.3.0 → 4.0.02021-10-03

4.6.0 → 5.0.02024-07-25

PHP version history (8 changes)3.0.0PHP ^7.1

3.3.0PHP ^7.1|^8.0

4.0.0PHP ^7.4|^8.0

4.1.0PHP 7.4.\*|8.0.\*|8.1.\*

4.3.0PHP 7.4.\*|8.0.\*|8.1.\*|8.2.\*

4.5.0PHP 7.4.\*|8.0.\*|8.1.\*|8.2.\*|8.3.\*

5.0.0PHP 8.0.\*|8.1.\*|8.2.\*|8.3.\*|8.4.\*

5.2.0PHP 8.0.\*|8.1.\*|8.2.\*|8.3.\*|8.4.\*|8.5.\*

### Community

Maintainers

![](https://www.gravatar.com/avatar/22ec38c802df71e6286b262e605a1b445f2657b8f834db0098d10a06c9ec1137?d=identicon)[gbuckingham89](/maintainers/gbuckingham89)

---

Top Contributors

[![gbuckingham89](https://avatars.githubusercontent.com/u/1455253?v=4)](https://github.com/gbuckingham89 "gbuckingham89 (19 commits)")

---

Tags

phplaravelnotificationsflashmessages

### Embed Badge

![Health badge](/badges/gbuckingham89-laraflash/health.svg)

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

###  Alternatives

[edvinaskrucas/notification

Package for Laravel for helping to manage flash / instant notifications / messages.

520393.9k10](/packages/edvinaskrucas-notification)[prologue/alerts

Prologue Alerts is a package that handles global site messages.

3486.1M30](/packages/prologue-alerts)[brian2694/laravel-toastr

toastr.js for Laravel

136649.4k5](/packages/brian2694-laravel-toastr)[defstudio/pest-plugin-laravel-expectations

A plugin to add laravel tailored expectations to Pest

98548.9k4](/packages/defstudio-pest-plugin-laravel-expectations)[cartalyst/alerts

Alerts allows you to easily pass alert messages to your Laravel views.

3064.2k](/packages/cartalyst-alerts)[devmarketer/laraflash

A powerful and flexible flash notifications system. Improving over built-in Laravel Flash messaging functionality.

6310.3k1](/packages/devmarketer-laraflash)

PHPackages © 2026

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