PHPackages                             thecodemill/flash-message - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. thecodemill/flash-message

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

thecodemill/flash-message
=========================

1.1(7y ago)0288MITPHP

Since Jan 19Pushed 7y ago1 watchersCompare

[ Source](https://github.com/thecodemill/flash-message)[ Packagist](https://packagist.org/packages/thecodemill/flash-message)[ RSS](/packages/thecodemill-flash-message/feed)WikiDiscussions master Synced 6d ago

READMEChangelogDependencies (1)Versions (3)Used By (0)

FlashMessage
============

[](#flashmessage)

A simple PHP container for passing session (flash) messages between page redirects.

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

[](#installation)

Install the FlashMessage package via Composer:

```
composer require thecodemill/flash-message

```

Usage
-----

[](#usage)

FlashMessage is used to make messages of 4 different statuses:

- INFO
- SUCCESS
- WARNING
- DANGER

A message can be created by instantiating a new `TheCodeMill\FlashMessage\Message` class, with the appropriate arguments:

```
use TheCodeMill\FlashMessage\Message;

$message = new Message('The problem with the gene pool is there’s no lifeguard', Message::STATUS_INFO);
```

Alternatively, static helper methods are available to automatically generate a message of each particular status:

```
use TheCodeMill\FlashMessage\Message;

// Info
$info = Message::info('I have noticed something strange.');

// Warning
$warning = Message::warning('This could be a problem.');

// Danger
$danger = Message::danger('Yes, it was definitely a problem.');

// Success
$success = Message::success('All fixed!');
```

These messages can then be passed into session storage and flashed between page redirects.

Here's a Laravel example:

```
Route::post('/submit', function () {
    // Do something
    // ...

    // Now redirect
    return redirect('/success')
        ->with('message', Message::success('Thanks for submitting.'));
});
```

To output the message, we may use the `content()` and `status()` methods on the Message object.

**Note:** You may notice that the status types tie in nicely with Bootstrap's default types.

Here's another Laravel Blade example:

```
@if($message = session('message'))

    		&times;
    		Close

        {{ $message->content() }}

@endif
```

Author
------

[](#author)

- [Andrew Robinson](https://twitter.com/ap_robinson)

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity64

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

Total

2

Last Release

2839d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/7934963?v=4)[Andrew Robinson](/maintainers/TheCodeMill)[@thecodemill](https://github.com/thecodemill)

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

PHPackages © 2026

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