PHPackages                             hajtuj/laravel-flash-messages - 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. hajtuj/laravel-flash-messages

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

hajtuj/laravel-flash-messages
=============================

Simple, session based flash messages for Laravel application.

1.2.1(5y ago)248MITPHPPHP &gt;=7.3

Since Aug 31Pushed 5y ago1 watchersCompare

[ Source](https://github.com/hajtuJ/laravel-flash-messages)[ Packagist](https://packagist.org/packages/hajtuj/laravel-flash-messages)[ RSS](/packages/hajtuj-laravel-flash-messages/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (5)Dependencies (4)Versions (9)Used By (0)

Laravel Flash Messages
======================

[](#laravel-flash-messages)

> Simple, session based flash messages for Laravel applications.

[![Latest Version on Packagist](https://camo.githubusercontent.com/8c72a0704e5efa5701c137093567ab773fa05fbe39ac33b705bca896b4982e3a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f68616a74756a2f6c61726176656c2d666c6173682d6d657373616765732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/hajtuj/laravel-flash-messages)[![License](https://camo.githubusercontent.com/1e1cb7bae9fc55a01fc5443d26e358dc21c129253bcfa9841db85c4f25aa2ecf/687474703a2f2f696d672e736869656c64732e696f2f3a6c6963656e73652d6d69742d626c75652e7376673f7374796c653d666c61742d737175617265)](http://badges.mit-license.org)![StyleCI](https://camo.githubusercontent.com/51048e512141d283378aa96c4c1e2086765ee80fe7946b2ea936c24b16200f5d/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f3239313236333838312f736869656c643f6272616e63683d6d6173746572)[![](https://github.com/hajtuj/laravel-flash-messages/workflows/Tests/badge.svg?branch=master)](https://github.com/hajtuj/laravel-flash-messages/workflows/Tests/badge.svg?branch=master)

[![Alerts](https://camo.githubusercontent.com/6600c8335626b30bb8532417ff1d17f15bdfaeba35fb8c433bb35474b35cd0d2/68747470733a2f2f692e696d6775722e636f6d2f5362354d7143482e706e67 "Alerts")](#)

Content
-------

[](#content)

- [Installation](#installation)
- [Usage](#usage)
- [Setup](#setup)
- [Donations](#donations)
- [License](#license)

---

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

[](#installation)

Just pull package through composer

```
composer require hajtuj/laravel-flash-messages

```

Add component tag to Your layout template

```

```

---

Package is created to work as default with css framework **Twitter Bootstrap v4**. Information how to [add boostrap to Your project](https://getbootstrap.com/docs/4.5/getting-started/introduction/)or simply add inline link to css file of bootstrap:

```

```

and js file to make messages able to hide:

```

```

Usage
-----

[](#usage)

U can simply call flash messages from macro added to `RedirectResponse`. Macro name is created from config macro values and type of flash message:

> **macro prefix** + type + **macro suffix**

```
public function store() {
    return redirect('/')->successMsg('Your message');
}
```

```
public function store() {
    return back()->successMsg('Your message');
}
```

---

You are able to use handy helper method:

```
public function store() {
    flash('message', 'info');
    return back();
}
```

or by chaining it with message type:

```
public function store() {
    flash('message')->success();
    return back();
}
```

---

You can also receive class of `FlashMessageContract $flash` in constructor method of your controller:

```
public function store(FlashMessageContract $flash) {
    $flash->flashMessage('Hey! Successfully stored resource', 'success');
}
```

### Setup

[](#setup)

You can always export config file and views to make your own modifications

> exporting config to `config/flash-message.php`

```
$ php artisan flash-message:config
```

> exporting view file to `resources/views/vendor/flash-message/bootstrap.blade.php`

```
$ php artisan flash-message:views
```

> you can add own types of messages in to config file:

```
/**
 *  Types are used to name classes in html code of alerts
 */
'types' => ['primary', 'secondary', 'success', 'danger', 'warning', 'info', 'light', 'dark'],
```

> to modify class for each type add own suffix and prefixes in config file

```
/**
* Class prefix and suffix is added to type of alert to create class name
*/
'class' => [
    'prefix' => 'alert-',
    'suffix' => '',
],
```

---

Donations
---------

[](#donations)

If You like my work and U would like to share with me just
[![Buy Me A Coffee](https://camo.githubusercontent.com/e9aa2120403febc22384c319070cfa5c36d1849fa75fdb74c1dfe83a8c136ef2/68747470733a2f2f7777772e6275796d6561636f666665652e636f6d2f6173736574732f696d672f637573746f6d5f696d616765732f626c61636b5f696d672e706e67)](https://www.buymeacoffee.com/hajtuJ)

---

License
-------

[](#license)

[![License](https://camo.githubusercontent.com/1e1cb7bae9fc55a01fc5443d26e358dc21c129253bcfa9841db85c4f25aa2ecf/687474703a2f2f696d672e736869656c64732e696f2f3a6c6963656e73652d6d69742d626c75652e7376673f7374796c653d666c61742d737175617265)](http://badges.mit-license.org)

- **[MIT license](http://opensource.org/licenses/mit-license.php)**
- Copyright 2020 © [](mailto:bolek.sebastian@gmail.com).

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity55

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

Recently: every ~59 days

Total

7

Last Release

1842d ago

PHP version history (2 changes)v1.0PHP ^7.3

1.2.1PHP &gt;=7.3

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/8777448?v=4)[Sebastian Bolek](/maintainers/hajtuJ)[@hajtuJ](https://github.com/hajtuJ)

---

Top Contributors

[![hajtuJ](https://avatars.githubusercontent.com/u/8777448?v=4)](https://github.com/hajtuJ "hajtuJ (86 commits)")

---

Tags

laravelflashmessagesalert

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/hajtuj-laravel-flash-messages/health.svg)

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

###  Alternatives

[prologue/alerts

Prologue Alerts is a package that handles global site messages.

3486.1M30](/packages/prologue-alerts)[masmerise/livewire-toaster

Beautiful toast notifications for Laravel / Livewire.

505550.3k6](/packages/masmerise-livewire-toaster)[coderello/laraflash

Advanced flash messages for Laravel.

15737.2k1](/packages/coderello-laraflash)[cartalyst/alerts

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

3064.2k](/packages/cartalyst-alerts)[caffeinated/flash

Flash Messages for Laravel

4649.5k2](/packages/caffeinated-flash)[gerardojbaez/messenger

Messenger functionality for Laravel 5.2.

738.5k](/packages/gerardojbaez-messenger)

PHPackages © 2026

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