PHPackages                             moataz/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. moataz/notify

ActiveLibrary

moataz/notify
=============

A site notification package for laravel.

1178PHP

Since Oct 21Pushed 3y agoCompare

[ Source](https://github.com/MoatazAbdAlmageed/laravel-notify)[ Packagist](https://packagist.org/packages/moataz/notify)[ RSS](/packages/moataz-notify/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

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

17

—

LowBetter than 6% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity24

Early-stage or recently created project

 Bus Factor1

Top contributor holds 50% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/abef4e486e4ddd4884fb9593b5b1ff327b3dfe17f014d3b59335810e28e7dda8?d=identicon)[Moataz Mohammady](/maintainers/Moataz%20Mohammady)

---

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)")[![MoatazAbdAlmageed](https://avatars.githubusercontent.com/u/17373050?v=4)](https://github.com/MoatazAbdAlmageed "MoatazAbdAlmageed (1 commits)")

### Embed Badge

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

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

PHPackages © 2026

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