PHPackages                             tjgazel/laravel-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. [Mail &amp; Notifications](/categories/mail)
4. /
5. tjgazel/laravel-toastr

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

tjgazel/laravel-toastr
======================

Toastr notifications for laravel 5.5+, 6 and 7

v1.1.0(5y ago)1512.7k↓50%4MITPHPPHP &gt;=7.0CI failing

Since May 20Pushed 5y ago1 watchersCompare

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

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

Toastr notifications for laravel 5.5+, 6 and 7
==============================================

[](#toastr-notifications-for-laravel-55-6-and-7)

[![Latest Stable Version](https://camo.githubusercontent.com/e5c6c3e18d3579f51fda45d9715bdbedabd3b953de14eee310dafdd049d5b046/68747470733a2f2f706f7365722e707567782e6f72672f746a67617a656c2f6c61726176656c2d746f617374722f762f737461626c65)](https://packagist.org/packages/tjgazel/laravel-toastr)[![License](https://camo.githubusercontent.com/fe0a5587fe9590c1d6f5bef99013c9c47d5fb01b54c686683f504ef040241c2b/68747470733a2f2f706f7365722e707567782e6f72672f746a67617a656c2f6c61726176656c2d746f617374722f6c6963656e7365)](https://github.com/tjgazel/laravel-toastr/blob/master/LICENSE)[![Total Downloads](https://camo.githubusercontent.com/b2f718ac5b5469d98ba86492e7c389478e781cbcdccbf31101bfeeea4ddbb512/68747470733a2f2f706f7365722e707567782e6f72672f746a67617a656c2f6c61726176656c2d746f617374722f646f776e6c6f616473)](https://packagist.org/packages/tjgazel/laravel-toastr)

[![](toastr.png)](toastr.png)

- [Instalation](#instalation)
- [Usage](#usage)
- [Tanks](#tanks)
- [Tutorial video](#tutorial)

**Other packages:**

- [tjgazel/laravel-bs4-alert](https://github.com/tjgazel/laravel-bs4-alert) - Bootstrap 4 alerts for laravel 5.\*
- [tjgazel/laravel-bs3-alert](https://github.com/tjgazel/laravel-bs3-alert) - Bootstrap 3 alerts for laravel 5.\*

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

[](#installation)

### 1) Install the Toastr library (front end dependency)

[](#1-install-the-toastr-library-front-end-dependency)

**1.1)** Install [Toastr](http://codeseven.github.io/toastr/) via npm . [Github](https://github.com/CodeSeven/toastr) | [Demo](http://codeseven.github.io/toastr/demo.html)

```
npm install toastr --save-dev

```

**1.2)** Require the js in resources/assets/js/bootstrap.js as `window.toastr = require('toastr');`

```
try {
  window.$ = window.jQuery = require('jquery');

  require('bootstrap');

  window.toastr = require('toastr');

} catch (e) { }

```

**1.3)** Import the sass in resources/assets/sass/app.scss as `@import "~toastr/toastr";` then build via npm `npm run prod`.

```
// Fonts
@import url("https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,700");

// Variables
@import "variables";

// Bootstrap
@import "~bootstrap/scss/bootstrap";

// Toastr
@import "~toastr/toastr";

```

### 2) Install tjgazel/laravel-toastr

[](#2-install-tjgazellaravel-toastr)

**2.1)** Run

```
composer require tjgazel/laravel-toastr
```

**2.2)** *Optional:* Laravel 5.4 and below
Add `TJGazel\Toastr\ToastrServiceProvider::class` to `providers` in `config/app.php`.
Add `'Toastr' => TJGazel\Toastr\Facades\Toastr::class` to `aliases` in `config/app.php`.

```
// config/app.php

'providers' => [
  // ...
  TJGazel\Toastr\ToastrServiceProvider::class,
],

'aliases' => [
  // ...
  'Toastr' => TJGazel\Toastr\Facades\Toastr::class,
],

```

**2.3)** Run `php artisan vendor:publish --provider="TJGazel\Toastr\ToastrServiceProvider"`to publish the config file in `config/toastr.php`

**2.4)** Add `{!! Toastr::render() !!}` Facade or `{!! toastr()->render() !!}` helper in your main view.

```

    {!! toastr()->render() !!}

```

**2.5)** *Optional:* Modify the publish configuration file locate at `config/toastr.php` to your liking.

```
