PHPackages                             lefuturiste/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. [Framework](/categories/framework)
4. /
5. lefuturiste/flash

ActiveLibrary[Framework](/categories/framework)

lefuturiste/flash
=================

Slim Framework Flash message service provider

0.5.0(8y ago)056MITPHPPHP &gt;=5.5.0

Since Aug 16Pushed 8y agoCompare

[ Source](https://github.com/lefuturiste/Slim-Flash)[ Packagist](https://packagist.org/packages/lefuturiste/flash)[ Docs](http://slimframework.com)[ RSS](/packages/lefuturiste-flash/feed)WikiDiscussions master Synced 2w ago

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

Slim Framework Flash Messages
=============================

[](#slim-framework-flash-messages)

[![Build Status](https://camo.githubusercontent.com/01f1613440ee7cb44fed6ea8f9dde634484c6dc4faa301bda658ca1190a59255/68747470733a2f2f7472617669732d63692e6f72672f736c696d7068702f536c696d2d466c6173682e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/slimphp/Slim-Flash)

This repository contains a Slim Framework Flash messages service provider. This enables you to define transient messages that persist only from the current request to the next request.

Install
-------

[](#install)

Via Composer

```
$ composer require slim/flash
```

Requires Slim 3.0.0 or newer.

Usage
-----

[](#usage)

```
// Start PHP session
session_start();

$app = new \Slim\App();

// Fetch DI Container
$container = $app->getContainer();

// Register provider
$container['flash'] = function () {
    return new \Slim\Flash\Messages();
};

$app->get('/foo', function ($req, $res, $args) {
    // Set flash message for next request
    $this->flash->addMessage('Test', 'This is a message');

    // Redirect
    return $res->withStatus(302)->withHeader('Location', '/bar');
});

$app->get('/bar', function ($req, $res, $args) {
    // Get flash messages from previous request
    $messages = $this->flash->getMessages();
    print_r($messages);

    // Get the first message from a specific key
    $test = $this->flash->getFirstMessage('Test');
    print_r($test);
});

$app->run();
```

> Please note that a message could be a string, object or array. Please check what your storage can handle.

### Using with Twig-View

[](#using-with-twig-view)

If you use [Twig-View](https://github.com/slimphp/Twig-View), then [slim-twig-flash](https://github.com/kanellov/slim-twig-flash) may be a useful integration package.

Testing
-------

[](#testing)

```
$ phpunit
```

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Josh Lockhart](https://github.com/codeguy)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

25

—

LowBetter than 36% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

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

Total

4

Last Release

3111d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/237a43763134833e785eaee2c646dc218b63a87a8b0943b585a7c9ce436fd306?d=identicon)[lefuturiste](/maintainers/lefuturiste)

---

Top Contributors

[![akrabat](https://avatars.githubusercontent.com/u/33135?v=4)](https://github.com/akrabat "akrabat (15 commits)")[![geggleto](https://avatars.githubusercontent.com/u/4027602?v=4)](https://github.com/geggleto "geggleto (11 commits)")[![silentworks](https://avatars.githubusercontent.com/u/79497?v=4)](https://github.com/silentworks "silentworks (10 commits)")[![codeguy](https://avatars.githubusercontent.com/u/31677?v=4)](https://github.com/codeguy "codeguy (4 commits)")[![designermonkey](https://avatars.githubusercontent.com/u/221344?v=4)](https://github.com/designermonkey "designermonkey (3 commits)")[![timwattenberg](https://avatars.githubusercontent.com/u/120251?v=4)](https://github.com/timwattenberg "timwattenberg (2 commits)")[![lefuturiste](https://avatars.githubusercontent.com/u/20988163?v=4)](https://github.com/lefuturiste "lefuturiste (2 commits)")[![rickycheers](https://avatars.githubusercontent.com/u/480247?v=4)](https://github.com/rickycheers "rickycheers (1 commits)")[![JoeBengalen](https://avatars.githubusercontent.com/u/11173689?v=4)](https://github.com/JoeBengalen "JoeBengalen (1 commits)")[![tflight](https://avatars.githubusercontent.com/u/4959691?v=4)](https://github.com/tflight "tflight (1 commits)")[![thinksalot](https://avatars.githubusercontent.com/u/568707?v=4)](https://github.com/thinksalot "thinksalot (1 commits)")[![bcremer](https://avatars.githubusercontent.com/u/55820?v=4)](https://github.com/bcremer "bcremer (1 commits)")

---

Tags

messageframeworkslimproviderflash

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[slim/flash

Slim Framework Flash message service provider

1532.3M102](/packages/slim-flash)[kanellov/slim-twig-flash

A Twig extension to access Slim Flash messages in templates

22109.2k11](/packages/kanellov-slim-twig-flash)[slim/twig-view

Slim Framework 4 view helper built on top of the Twig 3 templating component

3738.4M230](/packages/slim-twig-view)[gotzmann/comet

Modern PHP framework for building blazing fast REST APIs and microservices

68316.2k1](/packages/gotzmann-comet)[rubellum/slim-blade-view

Slim Framework 3 view helper built on the Blade component

1822.4k2](/packages/rubellum-slim-blade-view)[podcastcrawler/podcastcrawler

PHP library to find podcasts

402.7k1](/packages/podcastcrawler-podcastcrawler)

PHPackages © 2026

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