PHPackages                             am-mokhtari/alert-manager - 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. am-mokhtari/alert-manager

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

am-mokhtari/alert-manager
=========================

helper for set and show alerts on website by using sessions

v2.0.1(1y ago)110MITPHPPHP ^8.2

Since Aug 14Pushed 1y ago1 watchersCompare

[ Source](https://github.com/am-mokhtari/alert-manager)[ Packagist](https://packagist.org/packages/am-mokhtari/alert-manager)[ RSS](/packages/am-mokhtari-alert-manager/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)DependenciesVersions (4)Used By (0)

[![icon](https://camo.githubusercontent.com/7e3c00a4ecc6da96255b0360c3f81eb651c1d54a057a192863cfc841fbb79d3c/68747470733a2f2f692e696d6775722e636f6d2f686f544357364e2e6a7067)](https://camo.githubusercontent.com/7e3c00a4ecc6da96255b0360c3f81eb651c1d54a057a192863cfc841fbb79d3c/68747470733a2f2f692e696d6775722e636f6d2f686f544357364e2e6a7067)

What's the purpose of this package? 🤔
=====================================

[](#whats-the-purpose-of-this-package-)

This package helps you to categorize messages into four types as follows: `danger`, `warning`, `success` and `normal`.

You can set ***Flash Messages*** and retrieve them along with automatic deletion.

How to install 😃
================

[](#how-to-install-)

**Initially, you need to have the *[composer](https://composer.org)* installed.**

To install this package, follow the command:

```
composer require am-mokhtari/alert-manager

```

How to use 😵
============

[](#how-to-use-)

The functions in use, follow as below:
--------------------------------------

[](#the-functions-in-use-follow-as-below)

- Alert::addNormal(string $message, bool $isFlash)
- Alert::addSuccess(string $message, bool $isFlash)
- Alert::addWarning(string $message, bool $isFlash)
- Alert::addDanger(string $message, bool $isFlash)

This kind of functions is applicable to both regular `alerts` and `flash messages`.

This is to **add** a message to the group of alerts.

**If your message is considered as a flash message, you can assign a `true` value to `$isflash`.**

### Regular *alerts* functions

[](#regular-alerts-functions)

- Alert::getNormal()
- Alert::getSuccess()
- Alert::getWarning()
- Alert::getDanger()

This kind applies to receive all messages known as the mentioned type. The output would be of type **array**.

---

- Alert::all()

This function retrieves all messages as a **multidimensional array**.

---

- Alert::pullNormal()
- Alert::pullWarning()
- Alert::pullDanger()
- Alert::pullSuccess()

These functions retrieve messages as the mentioned type and remove them automatically.

The output would be of type **array**.

---

- Alert::pullAll()

This function retrieves all messages and removes them automatically.

The output would be **multidimensional array**.

---

- Alert::forgetNormalOne(int $key)
- Alert::forgetWarningOne(int $key)
- Alert::forgetDangerOne(int $key)
- Alert::forgetSuccessOne(int $key)

These functions remove the mentioned type message belonging to the `$key`.

The output would be **true**.

---

- Alert::forgetNormal()
- Alert::forgetSuccess()
- Alert::forgetWarning()
- Alert::forgetDanger()

These functions remove the mentioned type messages.

The output would be **true**.

---

- Alert::forgetAll()

This function removes all messages.

The output would be **true**.

### The following functions are used for *flash messages*:

[](#the-following-functions-are-used-for-flash-messages)

- Alert::pullNormalFlashes()
- Alert::pullSuccessFlashes()
- Alert::pullWarningFlashes()
- Alert::pullDangerFlashes()

These functions retrieve Flash Messages as the mentioned type and delete them automatically.

The output would be of type **array**.

---

- Alert::pullAllFlashes()

This function retrieves all Flash Messages and removes them automatically.

The output would be **multidimensional array**.

Contributing 🤝
==============

[](#contributing-)

To contribute this project, `fork` the project and share it with me after the changes in a `pull request`.

**Thankful** ✨

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance35

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

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

Total

3

Last Release

615d ago

Major Versions

v1.0.1 → v2.0.02024-09-02

PHP version history (2 changes)v1.0.1PHP ^8.1

v2.0.0PHP ^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/266170e60388d89639fd7774abcc34aec93684d8f3093b556af6f446bfae3f23?d=identicon)[am-mokhtari](/maintainers/am-mokhtari)

---

Top Contributors

[![am-mokhtari](https://avatars.githubusercontent.com/u/123626041?v=4)](https://github.com/am-mokhtari "am-mokhtari (3 commits)")

---

Tags

alertmanageralertsflash-messageswebsite-alert

### Embed Badge

![Health badge](/badges/am-mokhtari-alert-manager/health.svg)

```
[![Health](https://phpackages.com/badges/am-mokhtari-alert-manager/health.svg)](https://phpackages.com/packages/am-mokhtari-alert-manager)
```

###  Alternatives

[mirazmac/dotenvwriter

A PHP library to write values to .env (DotEnv) files

19129.3k7](/packages/mirazmac-dotenvwriter)[joegreen0991/config

Config component based on laravel's

233.3k](/packages/joegreen0991-config)

PHPackages © 2026

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