PHPackages                             kotfire/system-alerts - 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. kotfire/system-alerts

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

kotfire/system-alerts
=====================

Easy and simple system alerts for Laravel 4

v0.4(11y ago)288MITPHPPHP &gt;=5.4.0

Since Apr 14Pushed 11y ago1 watchersCompare

[ Source](https://github.com/kotfire/system-alerts)[ Packagist](https://packagist.org/packages/kotfire/system-alerts)[ RSS](/packages/kotfire-system-alerts/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (8)Used By (0)

System Alerts for Laravel 4
===========================

[](#system-alerts-for-laravel-4)

This is a Laravel 4 package to add an Alert system to a web application. It is designed to easily display one or more messages in a section of the web page. These messages are managed with artisan commands.

It includes a ServiceProvider and some commands to manage the alerts and automatically attach them to the output.

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

[](#installation)

This package is available on [packagist](http://packagist.org), just add it to your composer.json

```
"kotfire/system-alerts": "0.4.*"
```

After updating composer, add the ServiceProvider to the providers array in **app/config/app.php**

```
'Kotfire\SystemAlerts\SystemAlertsServiceProvider',
```

The alerts will be automatically injected to the output, but if you want to load them manually or do some extra actions you can add the facade to your facades in **app/config/app.php**

```
'SystemAlert' => 'Kotfire\SystemAlerts\Facades\SystemAlert',
```

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

[](#configuration)

You can publish assets and configure it through Laravel.

To publish config file use

```
$ php artisan config:publish kotfire/system-alerts

```

In the config file you may modify the default values used in the package

To publish views use

```
$ php artisan view:publish kotfire/system-alerts

```

By publishing the views you may edit the template used to display the alert messages and make them your own style

Usage
-----

[](#usage)

### Commands

[](#commands)

The package was designed to display a Maintenance alert message before performing artisan down, but these are not the only type of alerts that can be added.

#### Maintenance alerts

[](#maintenance-alerts)

***Add new maintenance alert***

```
$ php artisan alert:maintenance [-m "Custom message"] [-t "Next Maintenance (in minutes)"]

```

> Note: Parameters are optional, default values will be used if not present

Example:

```
$ php artisan alert:maintenance

```

or

```
$ php artisan alert:maintenance -m "Maintenance in {time}" -t 15

```

This add new maintenance alert:

- Message: "Maintenance in {time}"
- Datetime: NOW + 15min

Example:

```
"Maintenance in {time}" will be "Maintenance in 14 minutes"

```

After putting app in maintenance mode using `php artisan down` the maintenance alert message will be deleted

> Note: This will not occur if you use Artisan::call('down').

> **Important:** You only can add one maintenance alert at time, if you try to add another you will get `Maintenance alert already exists: "Message" `

***Delete maintenance alert***

```
$ php artisan alert:maintenance -d

```

#### Information alerts

[](#information-alerts)

Information alerts are a simple way to show some information to the web app users. This kind of alerts are not deleted automatically.

***Add new alert***

```
$ php artisan alert "Message" [-d "datetime"]

```

Example:

```
$ php artisan alert "This is an alert"

```

or

```
$ php artisan alert "This message will self-destruct in {time}" -d "12:50"

```

#### Common

[](#common)

***Delete alert by ID***

```
$ php artisan alert:delete ID

```

***View all alerts***

```
$ php artisan alert:list

```

***Delete all alerts***

```
$ php artisan alert:clear

```

#### Modifiers

[](#modifiers)

There are some modifiers you can use and will be replaced when the message is displayed:

ModifierDescriptionExampleResult{time}Show the remaining time to the maintenance datetime{time}10 minutes{date}Show the date to the maintenance as 'Y-m-d'{date}2015-04-01{datetime}Show the datetime to the maintenance as 'Y-m-d H:i:s'{datetime}2015-04-01 12:50:20{format|'dateformat'}Show the datetime to the maintenance as 'date format'{format|d/m/Y H:i}01/04/2015 12:50#### Sorting

[](#sorting)

> Important: This feature was introduced in *version 0.3*, if you were using the package before this version re-publish the config file ([Configuration](#configuration))

Alerts can be sorted using one or more attributes.

By default the alerts will be sorted by type, then by the specified datetime and finally by the datetime they were created(all of them in ascending order).

The attribute 'type' is a bit special and needs more configurations, if you are using type sorting, you must set the priority. This is an array where the first element is the most priority and the last the less.

```
'type_priority' => ['maintenance', 'info'],

```

***Configure***

To configure the alerts sorting go to the config file.

Sorting can be a String(sort by ONE attribute) or an Array of strings(sort by more than one attributes).

Single attribute sorting:

```
'sort_by' => 'created_at',

```

Multiple attribute sorting:

```
'sort_by' => ['type', 'datetime', 'created_at'],

```

To define the order used in the attributes modify order

Order can be a String(same order for all attributes) or an Array of strings(different order for each attribute).

Same order:

```
'order' => 'asc',

```

Different order:

```
'order' => ['asc', 'desc', 'asc'],

```

### Events

[](#events)

There are some events that will be fired:

Event nameDescriptionParametersystem-alerts::alert.addedFired when alert was succesfully addedAlert added (Array)system-alerts::alert.deletedFired when alert was succesfully deletedAlert deleted (Array)system-alerts::alert.clearedFired when all the alerts are deletedNull### Display

[](#display)

There are two ways to display the alerts: auto and manual

#### Auto

[](#auto)

In this way alerts will be injected in all the responses containing a html element with the ID speficied in the config file (by default: 'alerts-container') using the template view to render them.

You just need to add a html container with the ID to all the views where you want to show the alerts.

Example:

```

```

#### Manual

[](#manual)

If you want to inject the alerts yourself, this is perfect for you.

Ensure you have been added the facade ([Installation](#installation)) and set the config option 'inject' to false.

Now you may load the alerts using

```
$alerts = SystemAlert::loadAlerts();
```

and attach them to a View or do some logic with them.

License
-------

[](#license)

System Alerts is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT)

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity53

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

Total

7

Last Release

4019d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/302fbf3c48edb94f91e03d58cfdd237b77ad98d968df402f599d64a9a5841378?d=identicon)[kotfire](/maintainers/kotfire)

---

Top Contributors

[![kotfire](https://avatars.githubusercontent.com/u/8735081?v=4)](https://github.com/kotfire "kotfire (16 commits)")

---

Tags

messagelaravelmaintenancealert

### Embed Badge

![Health badge](/badges/kotfire-system-alerts/health.svg)

```
[![Health](https://phpackages.com/badges/kotfire-system-alerts/health.svg)](https://phpackages.com/packages/kotfire-system-alerts)
```

###  Alternatives

[nahid/talk

Talk is a Laravel based realtime messaging, chatting and conversation system. It helps to develop users messaging, chatting and conversations in easy way.

1.6k58.1k4](/packages/nahid-talk)[harris21/laravel-fuse

Circuit breaker for Laravel queue jobs. Protect your workers from cascading failures.

3786.5k](/packages/harris21-laravel-fuse)[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)
