PHPackages                             andheiberg/notify - 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. [Mail &amp; Notifications](/categories/mail)
4. /
5. andheiberg/notify

ActiveLibrary[Mail &amp; Notifications](/categories/mail)

andheiberg/notify
=================

A site notification package for laravel.

2.0.0(10y ago)129.1k5[1 issues](https://github.com/AndreasHeiberg/laravel-notify/issues)1PHPPHP &gt;=5.3.0

Since Mar 23Pushed 9y ago2 watchersCompare

[ Source](https://github.com/AndreasHeiberg/laravel-notify)[ Packagist](https://packagist.org/packages/andheiberg/notify)[ RSS](/packages/andheiberg-notify/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (5)Versions (7)Used By (1)

Notify
======

[](#notify)

A site notification package for laravel.

Currently let's you easily flash notifications to the session. It also supports laravels translation package out of the box.

Table of Contents
-----------------

[](#table-of-contents)

- [Installation](#installation)
- [Configuration](#configuration)
- [Usage](#usage)
    - [Adding Notifications](#adding-notifications)
    - [Displaying Notifications](#displaying-notifications)

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

[](#installation)

You can install the package for your Laravel project through Composer.

```
# Laravel 4x
composer require andheiberg/notify:1.*

# Laravel 5x
composer require andheiberg/notify:2.*
```

Register the service provider in `app/config/app.php`.

```
Andheiberg\Notify\NotifyServiceProvider::class,
```

Add the alias to the list of aliases in `app/config/app.php`.

```
'Notify' => Andheiberg\Notify\Facades\Notify::class,
```

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

[](#configuration)

The packages provides you with some configuration options.

To create the configuration file run this command in your command line app:

```
# Laravel 4x
php artisan config:publish andheiberg/notify

# Laravel 5x
php artisan vendor:publish --provider="Andheiberg\Notify\NotifyServiceProvider"
```

The configuration file will be published here: `app/config/packages/andheiberg/notify/config.php`.

Usage
-----

[](#usage)

### Adding Notifications

[](#adding-notifications)

By default, the package has some notification types defined in its configuration file. The default types are `success`, `error`, `warning` and `info`.

Every type can be called as a function.

```
Notify::info('This is an info message.');
Notify::error('Whoops, something has gone wrong.');
```

You can of course add your own types by adding them to your own config file. [See above](#configuration) on how to publish the config file.

You can also pass a language tag for easy localization.

```
Notify::success('auth.login-successful'); // Calls Lang::get('auth.login-successful') behind the scene
Notify::warning('auth.verification-email-sent', ['email' => 'test@gmail.com']) // You can also pass replacements
```

### Displaying Notifications

[](#displaying-notifications)

`Notify` class is just an extension of Illuminate's `MessageBag` class, which means we can use all of its functionality to display messages.

```
@foreach (Notify::all() as $notification)
    {{ $notification }}
@endforeach
```

Or if you'd like to display a single notification for a certain level.

```
@if (Notify::has('success'))
    {{ Notify::first('success') }}
@endif
```

If you'd like to learn more ways on how you can display messages, please [take a closer look to Illuminate's `MessageBag` class](https://github.com/illuminate/support/blob/master/MessageBag.php).

#### Bootstrap example

[](#bootstrap-example)

```
@if (Notify::all())

		@foreach (Notify::get('success') as $alert)

				&times;
				{{ $alert }}

		@endforeach

		@foreach (Notify::get('error') as $alert)

				&times;
				{{ $alert }}

		@endforeach

		@foreach (Notify::get('info') as $alert)

				&times;
				{{ $alert }}

		@endforeach

		@foreach (Notify::get('warning') as $alert)

				&times;
				{{ $alert }}

		@endforeach

@endif
```

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity29

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 66.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 ~104 days

Recently: every ~130 days

Total

6

Last Release

3912d ago

Major Versions

1.0.x-dev → 2.0.02015-08-27

### Community

Maintainers

![](https://www.gravatar.com/avatar/207626c3611f7c70c59a8164259c22cb1233b0a8e009d1feae3e45c9351d4c4c?d=identicon)[AndreasHeiberg](/maintainers/AndreasHeiberg)

---

Top Contributors

[![gpedro](https://avatars.githubusercontent.com/u/2898638?v=4)](https://github.com/gpedro "gpedro (2 commits)")[![andheiberg](https://avatars.githubusercontent.com/u/820962?v=4)](https://github.com/andheiberg "andheiberg (1 commits)")

### Embed Badge

![Health badge](/badges/andheiberg-notify/health.svg)

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

###  Alternatives

[mckenziearts/laravel-notify

Flexible flash notifications for Laravel

1.7k1.1M5](/packages/mckenziearts-laravel-notify)[propaganistas/laravel-disposable-email

Disposable email validator

5762.6M6](/packages/propaganistas-laravel-disposable-email)[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)[laravel-notification-channels/apn

Apple APN Push Notification Channel

2021.9M4](/packages/laravel-notification-channels-apn)[brian2694/laravel-toastr

toastr.js for Laravel

136649.4k5](/packages/brian2694-laravel-toastr)

PHPackages © 2026

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