PHPackages                             gertjanroke/notification - 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. gertjanroke/notification

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

gertjanroke/notification
========================

notifications

1.1.0(10y ago)020MITPHPPHP &gt;=5.3.0

Since Oct 19Pushed 9y ago1 watchersCompare

[ Source](https://github.com/GertjanRoke/notification)[ Packagist](https://packagist.org/packages/gertjanroke/notification)[ Docs](https://github.com/gertjanroke/notification)[ RSS](/packages/gertjanroke-notification/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (2)Versions (6)Used By (0)

Notification
============

[](#notification)

Flash notification that accepts a array and string. You can use it from your controller and also in the views.

Install
-------

[](#install)

```
composer require gertjanroke/notification
```

After install
-------------

[](#after-install)

#### ServiceProvider

[](#serviceprovider)

Add the following line to `config/app.php`.

at `providers`:

```
Gertjanroke\Notification\NotificationServiceProvider::class,
```

And at `aliases`:

```
'Notification' => Gertjanroke\Notification\Facade\Notification::class,
```

#### Publish files

[](#publish-files)

Run the following command:

```
php artisan vendor:publish
```

Usage
-----

[](#usage)

#### Including the flash message in your view

[](#including-the-flash-message-in-your-view)

To see the flash notification(s), you need to add the following `@include()`.

```
@include('notification::message')
```

And if you want the basic styling that comes with the package, also inlcude the following lines:

```

```

And the javascript:

```

```

###### NOTE: You also need the jQuery library.

[](#note-you-also-need-the-jquery-library)

Usage from the Controller
-------------------------

[](#usage-from-the-controller)

### available functions

[](#available-functions)

Creating a notification can be done with the next commands:

```
Notification::
    - success()
    - error()
    - warning()
    - info()
    - overlay() // Bootstrap modal
```

You can also add the class "Important" to the alert message, with the following command:

```
Notification::error('message', 'title')->important();
```

#### Message variables

[](#message-variables)

You can send a message as a string or as a array.

Syntax:

```
Notification::success([
                    'First success',
                    'Second success title' => [
                        'First success',
                        'Second success'
                    ],
                    'Third success'
                ]);

Notification::success('First success');
```

#### Title

[](#title)

The last string is the title. You have two options: give a string or leave it blank.

With title:

```
Notification::success('First success', 'Title success block');
```

Without title:

```
Notification::success('First success');
```

#### Overlay function

[](#overlay-function)

When you want to use a [Modal from bootstrap](http://getbootstrap.com/javascript/#modals) you can do so with the following function and syntax:

```
Notification::overlay( 'Message', 'Title' );
```

###### NOTE: All the given variables need to be a string.

[](#note-all-the-given-variables-need-to-be-a-string)

Usage from the view
-------------------

[](#usage-from-the-view)

You can also create a notification from the view file, this is usefull when your using a ajax form.

### available functions

[](#available-functions-1)

Creating a notification can be done with the next commands:

```
Notification.
    - success()
    - error()
    - warning()
    - info()
    - overlay() // Bootstrap modal
```

### Messages, Title and Important

[](#messages-title-and-important)

You can send a message as a string or as a array.

###### NOTE: The overlay function only accepts strings.

[](#note-the-overlay-function-only-accepts-strings)

#### Messages

[](#messages)

The following syntax is used at all functions but NOT FOR: `.overlay()`:

Single message:

```
Notification.success( 'First message' );
```

Multiple single messages:

```
Notification.success( ['First message', 'Second message', 'Third message'] );
```

Grouping messages:

```
Notification.success( {'Third message with array': ['First message', 'Second message']} );
```

Grouping messages inside a Array of messages:

```
Notification.success( ['First message', 'Second message', {'Third message with array': ['First message', 'Second message']}] );
```

#### Title

[](#title-1)

Adding a title to a notification:

```
Notification.success( 'message', 'The Title goes after the message' );
```

#### Important

[](#important)

Adding the class `important` to your notification is easly done with adding a boolean as last variable:

```
Notification.success( 'message', 'Title', TRUE );
```

### Overlay function

[](#overlay-function-1)

When you want to use a [Modal from bootstrap](http://getbootstrap.com/javascript/#modals) you can do so with the following function and syntax:

```
Notification.overlay( 'Message', 'Title', 'Button text' );
```

###### NOTE: All the given variables need to be a string.

[](#note-all-the-given-variables-need-to-be-a-string-1)

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity62

Established project with proven stability

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

Total

5

Last Release

3668d ago

Major Versions

0.0.2 → 1.0.02016-03-11

### Community

Maintainers

![](https://www.gravatar.com/avatar/8ab268dd9dc85846a497980d67527038e64f692e579fdad486c79a9ecad5ce93?d=identicon)[GertjanRoke](/maintainers/GertjanRoke)

---

Top Contributors

[![gjroke](https://avatars.githubusercontent.com/u/20582379?v=4)](https://github.com/gjroke "gjroke (2 commits)")

---

Tags

notificationnotifications

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/gertjanroke-notification/health.svg)

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

###  Alternatives

[minishlink/web-push

Web Push library for PHP

1.9k12.0M52](/packages/minishlink-web-push)[mouse0270/bootstrap-growl

This is a simple pluging that turns standard Bootstrap alerts into "Growl-like" notifications.

2.2k119.1k](/packages/mouse0270-bootstrap-growl)[symfony/notifier

Sends notifications via one or more channels (email, SMS, ...)

80640.3M290](/packages/symfony-notifier)[liran-co/laravel-notification-subscriptions

Notification subscription management.

128239.2k1](/packages/liran-co-laravel-notification-subscriptions)[bentools/webpush-bundle

Send push notifications through Web Push Protocol to your Symfony users.

71274.3k](/packages/bentools-webpush-bundle)[naif/nova-push-notification

A Laravel Nova tool to send push notifications via OneSignal

166.4k](/packages/naif-nova-push-notification)

PHPackages © 2026

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