PHPackages                             artdarek/toastr - 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. artdarek/toastr

ActiveLibrary

artdarek/toastr
===============

Toastr - Flash Messages for Laravel 5

2.0.0(9y ago)03.7k2[1 issues](https://github.com/artdarek/toastr/issues)MITPHPPHP &gt;=5.3.0

Since Feb 9Pushed 9y ago1 watchersCompare

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

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

Toastr - Flash Messages for Laravel 5
=====================================

[](#toastr---flash-messages-for-laravel-5)

Simple flash messagges system to use with Laravel 5 Framework. By default it relies on twitter bootstrap "alert" component. You can display multiple flash messages in different types (success, info, warning, danger) at once and to each message you can asign some custom params that will allow you for example mark some of them as important etc.

---

- [Installation](#installation)
- [Registering the Package](#registering-the-package)
- [Usage](#usage)

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

[](#installation)

#### Via composer require command

[](#via-composer-require-command)

Use [composer](http://getcomposer.org) require command to install this package.

```
$ composer require artdarek/toastr
```

#### Laravel version Compatibility

[](#laravel-version-compatibility)

LaravelPackage5.0.x1.0.x5.1.x1.0.x5.2.x2.0.x5.3.x2.0.x5.4.x2.0.x#### Adding package to composer.json file manually

[](#adding-package-to-composerjson-file-manually)

Add package to your composer.json file:

```
"require": {
  "artdarek/toastr": "2.0.*"
}

```

Use [composer](http://getcomposer.org) update command to install this package.

```
$ composer update
```

### Registering the Package

[](#registering-the-package)

Add the Toastr Service Provider to your config in `config/app.php`:

```
'providers' => array(
	Artdarek\Toastr\Providers\ToastrServiceProvider::class,
),
```

and create an alias:

```
'aliases' => [
    'Toastr'    => Artdarek\Toastr\Facades\Toastr::class,
],
```

Usage
-----

[](#usage)

First of all you need to add some code to your view scripts. In most cases it will be layout file (or other place where you want to flash message be displayed). You can use default view script distrubuted within this package by adding following code into your view file:

```
@include('toastr::alerts')
```

or to gain more controll of the look and feel of your flash messages you can start with using following template (just copy and paste it into a place where your application allerts should be displayed):

```
@if(Session::has('toastr.alerts'))

    @foreach(Session::get('toastr.alerts') as $alert)

            &times;

            @if( ! empty($alert['title']))
                {{ $alert['title'] }}
            @endif

            {{ $alert['message'] }}

            @if(array_get($alert,'params.important')) (This alert is marked as important) @endif

    @endforeach

@endif
```

In your controllers/action before you perform a redirect:

```
public function login()
{
	Toastr::success('Welcom back!')->push();
    return Redirect::home();
}
```

you can push more than one alert at once:

```
public function login()
{
	Toastr::success('Welcom back!')->push();
	Toastr::warning('You don\'t look too good today!')->push();

    return Redirect::home();
}
```

Other usage examples:

```
// using alert() method - first param is an alert type socond one is a message:
Toastr::alert('danger','Error - generated by alert() method')->push();
Toastr::alert('danger','Error - generated by alert() method')->push();
Toastr::alert('info','Info - generated by alert() method')->push();
Toastr::alert('warning','Warning - generated by alert() method')->push();
Toastr::alert('success','Success - generated by alert() method')->push();

// error alert with title
Toastr::alert('danger',['Some title','Error - generated by alert() method'])->push();

// succes
Toastr::success('This is success')->push();

// success with title
Toastr::success('Excelent','This is success')->push();

// info
Toastr::info('That is just short info')->push();

// warning
Toastr::warning('Thats a warning!')->push();

// error
Toastr::danger('We got an error!')->push();

// adding additional params to each alert (with() method allows you to pass some custom params that can be used later in a view script)
Toastr::danger('We got an error! And its marked as important')->with(['important' => true])->push();
Toastr::danger('We got an error!', 'But its not that important')->with(['important' => false])->push();
```

###  Health Score

30

—

LowBetter than 65% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 75% 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 ~0 days

Total

2

Last Release

3377d ago

Major Versions

1.0.1 → 2.0.02017-02-09

### Community

Maintainers

![](https://www.gravatar.com/avatar/98c27704daccc4dc6d490ba8c1a2c0bd5e86898ef589418036f3a608a08bd081?d=identicon)[artdarek](/maintainers/artdarek)

---

Top Contributors

[![artdarek](https://avatars.githubusercontent.com/u/1362351?v=4)](https://github.com/artdarek "artdarek (3 commits)")[![ptrstovka](https://avatars.githubusercontent.com/u/5551894?v=4)](https://github.com/ptrstovka "ptrstovka (1 commits)")

---

Tags

laravel 5alertstoastrflash-messages

### Embed Badge

![Health badge](/badges/artdarek-toastr/health.svg)

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

###  Alternatives

[prologue/alerts

Prologue Alerts is a package that handles global site messages.

3486.1M30](/packages/prologue-alerts)[brian2694/laravel-toastr

toastr.js for Laravel

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

PHPackages © 2026

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