PHPackages                             hieu-le/laravel-alert - 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. [Queues &amp; Workers](/categories/queues)
4. /
5. hieu-le/laravel-alert

ActiveLibrary[Queues &amp; Workers](/categories/queues)

hieu-le/laravel-alert
=====================

Laravel global site message system

2.2.0(8y ago)65.7k4[1 PRs](https://github.com/letrunghieu/laravel-alert/pulls)1MITPHPPHP &gt;=5.6.0

Since Apr 9Pushed 8y agoCompare

[ Source](https://github.com/letrunghieu/laravel-alert)[ Packagist](https://packagist.org/packages/hieu-le/laravel-alert)[ RSS](/packages/hieu-le-laravel-alert/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)Dependencies (6)Versions (12)Used By (1)

Laravel Alert
=============

[](#laravel-alert)

[![Build Status](https://camo.githubusercontent.com/37a55b4d7a1a14c0932534865f1fa27067d920d5f869e93ac2ba4e0e1088abe5/68747470733a2f2f7472617669732d63692e6f72672f6c657472756e67686965752f6c61726176656c2d616c6572742e737667)](https://travis-ci.org/letrunghieu/laravel-alert)[![Latest Stable Version](https://camo.githubusercontent.com/9f93415c7ce0ea819d26844bd2cdced47d2daed2531ed3fd2ff8c4f0a1ca18ee/68747470733a2f2f706f7365722e707567782e6f72672f686965752d6c652f6c61726176656c2d616c6572742f762f737461626c65)](https://packagist.org/packages/hieu-le/laravel-alert)[![Code Climate](https://camo.githubusercontent.com/fd294e620012fc0edae9aa63dfb5750370aef6d4eb8ba7a15d25d03b074ce9dd/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f6c657472756e67686965752f6c61726176656c2d616c6572742f6261646765732f6770612e737667)](https://codeclimate.com/github/letrunghieu/laravel-alert)[![Test Coverage](https://camo.githubusercontent.com/3b36d030969266455e6faaac7a7668c6688a2d14b7ec9a77bbfc4c37cb63cccd/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f6c657472756e67686965752f6c61726176656c2d616c6572742f6261646765732f636f7665726167652e737667)](https://codeclimate.com/github/letrunghieu/laravel-alert/coverage)[![Total Downloads](https://camo.githubusercontent.com/3cba0aa77c58b69e41eeec043e3e0d42f9a3e4201e5793baa3ef54534548b81e/68747470733a2f2f706f7365722e707567782e6f72672f686965752d6c652f6c61726176656c2d616c6572742f646f776e6c6f616473)](https://packagist.org/packages/hieu-le/laravel-alert)[![License](https://camo.githubusercontent.com/8ff8bd3ecda417ab3845e8ebc13f2956db23196428bb58d47eb5fae9a2504e97/68747470733a2f2f706f7365722e707567782e6f72672f686965752d6c652f6c61726176656c2d616c6572742f6c6963656e7365)](https://packagist.org/packages/hieu-le/laravel-alert)

Global site message system for **Laravel 4** (for Laravel 5, see [laravel-5](https://github.com/letrunghieu/laravel-alert/tree/laravel-5) branch)

The purpose of this package:
----------------------------

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

- Generate alerts in many semantic meaning: success, info, warning, error
- Flash collected messages to the next request
- Display collected messages to customizabled view, default to [Bootstrap 3 alert](http://getbootstrap.com/components/#alerts)
- Support icons for each type of message.

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

[](#installation)

You will need [Composer](https://getcomposer.org/doc/00-intro.md) to use this package. There is [a nice tutorial](http://code.tutsplus.com/tutorials/easy-package-management-with-composer--net-25530) of using Composer for those who are not familiar with this awesome tool.

Add this to your `composer.json` file.

```
"hieu-le/laravel-alert": "~1.0"
```

Run `composer update` to update all dependencies. After that, register the service provider for Laravel by adding this line to the `providers` array in `app/config/app.php`

```
'HieuLe\Alert\AlertServiceProvider',
```

And add this alias to the `aliases` array in `app/config/app.php`

```
'Alert' => 'HieuLe\Alert\Facades\Alert',
```

Usage
-----

[](#usage)

To add new message, use one of these four method. The name of each method is the type of the message you want to add.

```
Alert::success($message);
# or
Alert::info($message);
# or
Alert::warning($message);
# or
Alert::error($message);
```

To make these message available in next request, you must call `Alert::flash()` at least one time.

```
Alert::flash()
```

In your view, use the method `Alert::dump` to display these messages. By default, each type of message is rendered with the format of [Bootstrap 3 alert](http://getbootstrap.com/components/#alerts). You can change they appearance by reading the configuration section below.

Configuration
-------------

[](#configuration)

You can get more control over this package by modifying these configuations. First of all, publish the package config, so that you can edit the copied version:

```
php artisan config:publish hieu-le/laravel-alert

```

Open `app/config/packages/hieu-le/laravel-alert/config` file and change these settings:

- `session_key`: the name of the session key that stored messages between requests. You normally do not want to edit its value
- `icon`: the icon for each type of message when rendered in the default view. You can remove the value of one key to disable the icon for that type of message.
- `view`: the name of the view being used to render each type of message. In the view, you can use 2 variables: `$icon` is the icon of this message type; `$messages`: an array of messages of the current message type.

Work with Laravel validation errors result
------------------------------------------

[](#work-with-laravel-validation-errors-result)

To display the validation error, simply add another parameter to the `Alert::dump` method. For example

```
// In each view, there is a special variable call $errors
// This is the validation errors that is set by calling "withError" method as
// guided at http://laravel.com/docs/4.2/validation#error-messages-and-views

echo Alert::dump($errors->all());
```

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity25

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 85.7% 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 ~96 days

Recently: every ~216 days

Total

10

Last Release

3189d ago

Major Versions

0.0.2 → 1.0.02015-04-09

1.0.1 → 2.0.02015-04-11

1.1.0 → 2.1.02015-04-11

PHP version history (2 changes)0.0.1PHP &gt;=5.3.0

2.2.0PHP &gt;=5.6.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/98ce9136dff54b74ddb9afe69ae5c9c0cf573b00603e80ad9ee332f24f0b1342?d=identicon)[letrunghieu](/maintainers/letrunghieu)

---

Top Contributors

[![letrunghieu](https://avatars.githubusercontent.com/u/1145335?v=4)](https://github.com/letrunghieu "letrunghieu (12 commits)")[![kroczekmilosz](https://avatars.githubusercontent.com/u/13123473?v=4)](https://github.com/kroczekmilosz "kroczekmilosz (2 commits)")

---

Tags

messagelaravelbootstrapalertglobal

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/hieu-le-laravel-alert/health.svg)

```
[![Health](https://phpackages.com/badges/hieu-le-laravel-alert/health.svg)](https://phpackages.com/packages/hieu-le-laravel-alert)
```

###  Alternatives

[proengsoft/laravel-jsvalidation

Validate forms transparently with Javascript reusing your Laravel Validation Rules, Messages, and FormRequest

1.1k2.3M49](/packages/proengsoft-laravel-jsvalidation)[prologue/alerts

Prologue Alerts is a package that handles global site messages.

3486.1M30](/packages/prologue-alerts)[baklysystems/laravel-chat-messenger

Laravel chat package

121.8k](/packages/baklysystems-laravel-chat-messenger)

PHPackages © 2026

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