PHPackages                             drewpereli/flasher - 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. drewpereli/flasher

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

drewpereli/flasher
==================

Flash messages for php

1.0(9y ago)027MITPHP

Since Mar 26Pushed 9y ago1 watchersCompare

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

READMEChangelogDependenciesVersions (2)Used By (0)

Flasher
=======

[](#flasher)

This is a very small package that makes it easy to implement flash message.

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

[](#installation)

Install with composer.

```
composer require drewpereli/flasher

```

Or [download the source](github.com/drewpereli/flasher) from github.

Usage
-----

[](#usage)

Flasher is super easy to use! On any php file you'd like to use flahser in, include it by requiring the composer autoloader.

```
require_once "path/to/vendor/autoload.php";
```

If you're not using composer, simply include or require the file "flasher.php" in any file that uses the flasher.

```
require_once "path/to/flasher/flasher.php";
```

To set and get flash messages, create a new flasher object.

```
$flasher = new Flasher();
```

You can create a new flasher object at the top of each file that needs the flasher. The new object will have access to any flash messages set by any other existing or previous flasher object.

Set messages like this:

```
$flasher->set("message type", "your message here!"); //Sets message of type "message type" to "your message here".
```

Get messages like this:

```
$flasher->get("message type"); //Returns message of type "message type" (if there is one), and unsets it.
```

As soon as you "get" a message, it will be removed.

You can also use magic methods!

```
$flasher->message_type = "your message here!";
$message = $flasher->message_type; //"Your message here!"
$message = $flasher->message_type; //null
```

Full method list
================

[](#full-method-list)

- **set(type, message)**: Sets message of "type" to "message".
- **get(type)**: Returns and unsets the message of "type".
- **getAll()**: Returns an array of all messages, indexed by type. Unsets all messages.
- **peek(type)**: Returns the message of "type" without unsetting it.
- **flash(type)**: Equivalent to "echo get(type);".
- **has(type)**: Returns true if a message of "type" has been set. Otherwise returns false.
- **hasAny()**: Returns true if a flash message of any type is currently set. Otherwise returns false.

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity63

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

Unknown

Total

1

Last Release

3335d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/09d13df5d85a71085b1daf504c723fe7d41170f5c5a221d15e71dc4a9adb2806?d=identicon)[drewpereli](/maintainers/drewpereli)

---

Top Contributors

[![drewpereli](https://avatars.githubusercontent.com/u/9732858?v=4)](https://github.com/drewpereli "drewpereli (20 commits)")

### Embed Badge

![Health badge](/badges/drewpereli-flasher/health.svg)

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

###  Alternatives

[deved/magento2-disable-customer-registration

Disable Customer Registration

50133.3k](/packages/deved-magento2-disable-customer-registration)[appwilio/russianpost-sdk

Russian Post (pochta.ru) SDK

4615.7k](/packages/appwilio-russianpost-sdk)

PHPackages © 2026

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