PHPackages                             arkraft/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. [Utility &amp; Helpers](/categories/utility)
4. /
5. arkraft/alerts

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

arkraft/alerts
==============

Using bootstrap growl to create alerts inside controllers.

1.0(11y ago)093MITPHPPHP &gt;=5.4.0

Since Oct 26Pushed 11y agoCompare

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

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

alerts
======

[](#alerts)

Laravel 4 Alerts provider to add bootstrap alerts from controllers using the great [bootstrap-growl](https://github.com/ifightcrime/bootstrap-growl) jquery plugin by Nick Larson.

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

[](#installation)

Install with composer

```
composer require arkraft/alerts 0.8.0
```

Register the service provicer in `app/config/app.php` in the providers array

```
'Arkraft\Alerts\AlertsServiceProvider'
```

Add an alias under the alias array in `app/config/app.php`

```
'Alerts' => 'Arkraft\Alerts\Alerts',
```

And the last step ist to publish the assets. Execute the following command in the root of your project

```
php artisan asset:publish --path="vendor/arkraft/alerts/src/public/" jquery

```

This will add the `jquery.bootstrap-growl.min.js` to your `public/packages/jquery` directory. Usage
---------------------------------------------------------------------------------------------------

[](#this-will-add-the-jquerybootstrap-growlminjs-to-your-publicpackagesjquery-directoryusage)

Now you can add alerts from your controller. The following message types are possible

- Alerts::addInfo
- Alerts::addSuccess
- Alerts::addWarning
- Alerts::addDanger

All methods have the same parameters:

- message: the message you want to print
- title (optional): the title of the message (will be prepended in strong letters to the message)
- configuration (optional): additional configuration array For Example:

```
Alerts::addInfo("This is a simple info message", "Info");

```

will an the following message [![example info message](https://camo.githubusercontent.com/38965ba351537aa3cc5bc154c7408492fe5dcef21e1e37e2a55cb5ed92550244/687474703a2f2f7331342e64697265637475706c6f61642e6e65742f696d616765732f3134313032372f73376735756672662e706e67)](https://camo.githubusercontent.com/38965ba351537aa3cc5bc154c7408492fe5dcef21e1e37e2a55cb5ed92550244/687474703a2f2f7331342e64697265637475706c6f61642e6e65742f696d616765732f3134313032372f73376735756672662e706e67)

### Displaying the alerts

[](#displaying-the-alerts)

Add

```
{{ Alerts::getAlerts() }}

```

to your sites javascripts.

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

[](#configuration)

You can export the default configuration with

```
php artisan config:publish arkraft/alerts

```

This will export the following array to 'config/packages/arkraft/alerts/config.php'

```
return array(
    'offset' => '{from: "top", amount: 40}',
    'align' => 'right',
    'width' => 250,
    'delay' => 4000,
    'allowDismiss' => false,
    'stackupSpacing' => 5
);

```

The configuration values:

- offset: array with offset values, the alerts will apear 40px from top
- align: possible values are right, center and left.
- width: the width of the message box
- delay: delay for the message to disappear, this message will stay for 4 seconds before it disappears
- allowDismiss: true will print a close button on the right side of the alert box
- stackupSpacing: spacing between multiple alert boxes

The changes on this configuration file are global for all boxe. To change the configuration for a single alert you can use the configuration parameter like this

```
Alerts::addDanger("This is a simple error message", "Error", array("delay" => 0, "allowDismiss" => true, "align" => "center"));

```

This will show a message wich will stay in the center of the screen until it is closed with the close button on the right. Configurations passed as a parameter will overwrite the default configuration.

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity60

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

Total

3

Last Release

4220d ago

Major Versions

0.8.x-dev → 1.02014-10-27

### Community

Maintainers

![](https://www.gravatar.com/avatar/daf9792a8759e925380a0cd18d958f417116ce972d10670c81216bc5e0920707?d=identicon)[arkraft](/maintainers/arkraft)

---

Top Contributors

[![arkraft](https://avatars.githubusercontent.com/u/7426376?v=4)](https://github.com/arkraft "arkraft (5 commits)")

### Embed Badge

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

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

###  Alternatives

[barryvdh/laravel-ide-helper

Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.

14.9k123.0M687](/packages/barryvdh-laravel-ide-helper)[orchestra/canvas

Code Generators for Laravel Applications and Packages

21017.2M158](/packages/orchestra-canvas)[illuminate/pipeline

The Illuminate Pipeline package.

9446.6M213](/packages/illuminate-pipeline)[illuminate/pagination

The Illuminate Pagination package.

10532.5M862](/packages/illuminate-pagination)[spatie/laravel-pjax

A pjax middleware for Laravel 5

513371.8k11](/packages/spatie-laravel-pjax)[spatie/laravel-mix-preload

Add preload and prefetch links based your Mix manifest

169176.0k2](/packages/spatie-laravel-mix-preload)

PHPackages © 2026

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