PHPackages                             krubio/perfect-flash-bs-5 - 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. krubio/perfect-flash-bs-5

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

krubio/perfect-flash-bs-5
=========================

SOLID Compliant Session Based Flash Messaging - Bootstrap 5

v0.1.0(2y ago)026MITPHPPHP &gt;=8.1.0

Since Oct 10Pushed 2y ago1 watchersCompare

[ Source](https://github.com/benanamen/perfect-flash-bs-5)[ Packagist](https://packagist.org/packages/krubio/perfect-flash-bs-5)[ RSS](/packages/krubio-perfect-flash-bs-5/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (7)Versions (2)Used By (0)

[![codecov](https://camo.githubusercontent.com/957bfa133436338809b0131412c8a120261440409007547bb39a4a9ca0013cda/68747470733a2f2f636f6465636f762e696f2f67682f62656e616e616d656e2f706572666563742d666c6173682d62732d352f67726170682f62616467652e7376673f746f6b656e3d464474383435794d6247)](https://codecov.io/gh/benanamen/perfect-flash-bs-5)

[![Scrutinizer Code Quality](https://camo.githubusercontent.com/abb87e2c8caa993551ffdf4c39c0c1a6c89eea0684cb567fe419ea1cd9e4f5f4/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f62656e616e616d656e2f706572666563742d666c6173682d62732d352f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/benanamen/perfect-flash-bs-5/?branch=master)[![Code Coverage](https://camo.githubusercontent.com/6126fffb533fd2ef85c669207dc39340a78b279247e6bc6252b7c23417a882b4/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f62656e616e616d656e2f706572666563742d666c6173682d62732d352f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/benanamen/perfect-flash-bs-5/?branch=master)[![Build Status](https://camo.githubusercontent.com/ce8a3f81b685dec42f8f0cd2a793f54331c9f073c17abaaae6700c0bce8356cd/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f62656e616e616d656e2f706572666563742d666c6173682d62732d352f6261646765732f6275696c642e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/benanamen/perfect-flash-bs-5/build-status/master)[![Code Intelligence Status](https://camo.githubusercontent.com/b5c185de4f63b091dcfa0b3615363f7e4fe0011afb18e9effd2adf93114a1914/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f62656e616e616d656e2f706572666563742d666c6173682d62732d352f6261646765732f636f64652d696e74656c6c6967656e63652e7376673f623d6d6173746572)](https://scrutinizer-ci.com/code-intelligence)

[![Coverage](https://camo.githubusercontent.com/9bfc33bdb3e8649ac3bc31fb871e6add228365d371b89983e94c703b1ebca87e/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d62656e616e616d656e5f706572666563742d666c6173682d62732d35266d65747269633d636f766572616765)](https://sonarcloud.io/summary/new_code?id=benanamen_perfect-flash-bs-5)[![Maintainability Rating](https://camo.githubusercontent.com/91f195893122053191411fe11c97fee11a73d9bf102dcae744cff88b6654f51a/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d62656e616e616d656e5f706572666563742d666c6173682d62732d35266d65747269633d7371616c655f726174696e67)](https://sonarcloud.io/summary/new_code?id=benanamen_perfect-flash-bs-5)[![Code Smells](https://camo.githubusercontent.com/55526e59b823a3ca98a1ab0382a26c0314d4f3c8ea96d4c3211267a416a05e80/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d62656e616e616d656e5f706572666563742d666c6173682d62732d35266d65747269633d636f64655f736d656c6c73)](https://sonarcloud.io/summary/new_code?id=benanamen_perfect-flash-bs-5)[![Technical Debt](https://camo.githubusercontent.com/84ffdd6a858e6de0a1420648e01658d68d212f9c5c7ff999624c09f8ce8a8710/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d62656e616e616d656e5f706572666563742d666c6173682d62732d35266d65747269633d7371616c655f696e646578)](https://sonarcloud.io/summary/new_code?id=benanamen_perfect-flash-bs-5)[![Quality Gate Status](https://camo.githubusercontent.com/d400907418cefb00bf015c984449f00aa8b55c29b2abb1899926a74e63fc6f52/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d62656e616e616d656e5f706572666563742d666c6173682d62732d35266d65747269633d616c6572745f737461747573)](https://sonarcloud.io/summary/new_code?id=benanamen_perfect-flash-bs-5)[![Reliability Rating](https://camo.githubusercontent.com/55c1819cb6c1e7c1da42039f14ce19b69f419684b06a835dca619df051dee60b/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d62656e616e616d656e5f706572666563742d666c6173682d62732d35266d65747269633d72656c696162696c6974795f726174696e67)](https://sonarcloud.io/summary/new_code?id=benanamen_perfect-flash-bs-5)

[![Duplicated Lines (%)](https://camo.githubusercontent.com/a6fdfd69059f5d9e9f19803ce68bdaafef30cf00a6b56948d0d62ab5225b193e/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d62656e616e616d656e5f706572666563742d666c6173682d62732d35266d65747269633d6475706c6963617465645f6c696e65735f64656e73697479)](https://sonarcloud.io/summary/new_code?id=benanamen_perfect-flash-bs-5)[![Vulnerabilities](https://camo.githubusercontent.com/70eb1504b6dd1ca2ce1964539bf20c7232871e8471e6934adadfc35fc3d36370/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d62656e616e616d656e5f706572666563742d666c6173682d62732d35266d65747269633d76756c6e65726162696c6974696573)](https://sonarcloud.io/summary/new_code?id=benanamen_perfect-flash-bs-5)[![Bugs](https://camo.githubusercontent.com/d5af004891369e8e6fdb55e454ec6e2055df23a555cd638813b205c295a96214/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d62656e616e616d656e5f706572666563742d666c6173682d62732d35266d65747269633d62756773)](https://sonarcloud.io/summary/new_code?id=benanamen_perfect-flash-bs-5)[![Security Rating](https://camo.githubusercontent.com/853b12b24d58dba3e118e5dcb8d08113c90bfec11d0da2bd08f1b1f970f7ee96/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d62656e616e616d656e5f706572666563742d666c6173682d62732d35266d65747269633d73656375726974795f726174696e67)](https://sonarcloud.io/summary/new_code?id=benanamen_perfect-flash-bs-5)

Bootstrap5FlashMessage
======================

[](#bootstrap5flashmessage)

Description
-----------

[](#description)

`Bootstrap5FlashMessage` is a PHP class that provides a simple and effective way to display flash messages in a web application. It uses Bootstrap 5 for styling and allows for optional icons and dismissible alerts.

Requirements
------------

[](#requirements)

- PHP 8.0 or higher
- Bootstrap 5.3 or higher

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

[](#installation)

Include the `Bootstrap5FlashMessage` class in your project.

Usage
-----

[](#usage)

### Initialization

[](#initialization)

First, you need to inject a session object that implements `SessionInterface` and an array of messages into the constructor.

```
use PerfectApp\Session\SessionInterface;
use PerfectApp\Bootstrap5FlashMessage;

$session = new Session();  // This should implement SessionInterface
$messages = [
    'success' => [
        'insert' => 'Record Inserted'
    ],
    'danger' => [
        'failed_login' => 'Invalid Login'
    ]
];

$flash = new Bootstrap5FlashMessage($session, $messages);
```

### Adding a Message

[](#adding-a-message)

To add a flash message, use the `addMessage` method.

```
$flash->addMessage('success', 'insert');
```

You can also add an optional icon and make the alert dismissible.

```
$flash->addMessage('danger', 'failed_login', 'bi-x-circle', true);
```

### Displaying Messages

[](#displaying-messages)

To display all the flash messages, use the `displayMessages` method.

```
$flash->displayMessages();
```

This will output Bootstrap 5 styled alerts.

Testing
-------

[](#testing)

Run the following command to execute the unit tests and ensure 100% code coverage:

```
php vendor/bin/codecept run --coverage --coverage-html  --coverage-xml
```

License
-------

[](#license)

This project is licensed under the MIT License.

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

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

Unknown

Total

1

Last Release

943d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/92efcd3e8d87753dc819d970a254160b7ea8a60de6a127e7f93acada576b49c5?d=identicon)[benanamen](/maintainers/benanamen)

---

Top Contributors

[![benanamen](https://avatars.githubusercontent.com/u/1039435?v=4)](https://github.com/benanamen "benanamen (1 commits)")

---

Tags

bootstrapflash-messagesphp8flashflash messagebootstrap-5Session Flash Messaging

###  Code Quality

TestsCodeception

Static AnalysisPHPStan, Psalm

Type Coverage Yes

### Embed Badge

![Health badge](/badges/krubio-perfect-flash-bs-5/health.svg)

```
[![Health](https://phpackages.com/badges/krubio-perfect-flash-bs-5/health.svg)](https://phpackages.com/packages/krubio-perfect-flash-bs-5)
```

###  Alternatives

[plasticbrain/php-flash-messages

A modern take on PHP session-based flash messages

184229.6k8](/packages/plasticbrain-php-flash-messages)[coderello/laraflash

Advanced flash messages for Laravel.

15737.2k1](/packages/coderello-laraflash)[caffeinated/flash

Flash Messages for Laravel

4649.5k2](/packages/caffeinated-flash)[cartalyst/alerts

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

3064.2k](/packages/cartalyst-alerts)[sabre/amf

SabreAMF is a Flash Remoting server and client for PHP

415.9k1](/packages/sabre-amf)[ikkez/f3-flash

Add simple Flash Messages and Flash Keys to PHP Fat-Free Framework

1926.0k5](/packages/ikkez-f3-flash)

PHPackages © 2026

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