PHPackages                             luishuh/toastr-laravel-v2 - 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. luishuh/toastr-laravel-v2

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

luishuh/toastr-laravel-v2
=========================

Toastr notifications in laravel, new feature added. This library was created by roksta21@gmail.com.

1161PHP

Since Jan 14Pushed 8y ago1 watchersCompare

[ Source](https://github.com/LuisHuh/toastr-laravel)[ Packagist](https://packagist.org/packages/luishuh/toastr-laravel-v2)[ RSS](/packages/luishuh-toastr-laravel-v2/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependenciesVersions (1)Used By (0)

Toast
=====

[](#toast)

Simple toastr notifications for laravel

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

[](#installation)

Install [Toastr](https://github.com/CodeSeven/toastr) via npm

```
    npm install toastr --save
```

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

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

Install via composer

```
    composer require "luishuh/toastr-laravel-v2:@dev"
```

Include the service provider and its alias within the `config/app.php`.

```
'providers' => [
    LuisHuh\Toastr\ToastrServiceProvider::class,
];

'aliases' => [
    'Toast' => LuisHuh\Toastr\Toast::class,
];
```

Run

```
php artisan vendor:publish --provider="LuisHuh\Toastr\ToastrServiceProvider"
```

to publish the package view in your resources/assets/vendor/luishuh/toastr.blade.php

Add `@include('vendor.luishuh.toastr')` in your main view, eg,

```
    >

        @include('vendor.luishuh.toastr')

```

Use
---

[](#use)

Just use the helper function `toast()` to make the notifier.

```
    toast()->success('message', 'title');
    toast()->info('message', 'title');
    toast()->warning('message', 'title');
    toast()->error('message', 'title');
```

You may specify the timeout duration by

```
    toast()->success('message', 'title')->timeOut(5000);
```

You may activate the close button by

```
    toast()->success('message', 'title')->closeButton(true);
```

You may activate debug by

```
    toast()->success('message', 'title')->debug(true);
```

You may add the newest on top by

```
    toast()->success('message', 'title')->newestOnTop(true);
```

You may activate the progressBar by

```
    toast()->success('message', 'title')->progressBar(true);
```

You may change the position by

```
    toast()->success('message', 'title')->positionClass('top-right');
    toast()->success('message', 'title')->positionClass('bottom-right');
    toast()->success('message', 'title')->positionClass('bottom-left');
    toast()->success('message', 'title')->positionClass('top-left');
    toast()->success('message', 'title')->positionClass('top-full-width');
    toast()->success('message', 'title')->positionClass('bottom-full-width');
    toast()->success('message', 'title')->positionClass('top-center');
    toast()->success('message', 'title')->positionClass('bottom-center');
```

You may prevent duplicates by

```
    toast()->success('message', 'title')->preventDuplicates(true);
```

You may specify the show duration by

```
    toast()->success('message', 'title')->showDuration(300);
```

You may specify the hide duration by

```
    toast()->success('message', 'title')->hideDuration(1000);
```

You may extend the timeout duration by

```
    toast()->success('message', 'title')->extendedTimeOut(1000);
```

you may specify the speed of the animation to show and hide toastr by

```
    toast()->success('message', 'title')->showEasing('swing');
    toast()->success('message', 'title')->hideEasing('linear');
```

you can specify the type of the animation to show and hide toastr by

```
    toast()->success('message', 'title')->showMethod('fadeIn');
    toast()->success('message', 'title')->hideMethod('fadeOut');
```

you may add behavior on toast click

```

        function behavior(){
            alert("Hello World");
        }

```

```
    toast()->success('message', 'title')->onclick('behavior');
```

you may add all the options, you do not need to add all, only the ones you need.

```
    toast()->success('message', 'title')->options([
        'closeButton'       =>  true,
        'debug'             =>  false,
        'newestOnTop'       =>  false,
        'progressBar'       =>  true,
        'positionClass'     =>  'toast-top-right',
        'preventDuplicates' =>  false,
        'onclick'           =>  'behavior',
        'showDuration'      =>  300,
        'hideDuration'      =>  1000,
        'timeOut'           =>  5000,
        'extendedTimeOut'   =>  1000,
        'showEasing'        =>  'swing',
        'hideEasing'        =>  'linear',
        'showMethod'        =>  'fadeIn',
        'hideMethod'        =>  'fadeOut'
    ]);
```

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity41

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.

### Community

Maintainers

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

---

Top Contributors

[![LuisHuh](https://avatars.githubusercontent.com/u/13682165?v=4)](https://github.com/LuisHuh "LuisHuh (9 commits)")

---

Tags

laraveltoast-notifications

### Embed Badge

![Health badge](/badges/luishuh-toastr-laravel-v2/health.svg)

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

###  Alternatives

[tijsverkoyen/css-to-inline-styles

CssToInlineStyles is a class that enables you to convert HTML-pages/files into HTML-pages/files with inline styles. This is very useful when you're sending emails.

5.8k505.3M227](/packages/tijsverkoyen-css-to-inline-styles)[minishlink/web-push

Web Push library for PHP

1.9k12.0M53](/packages/minishlink-web-push)[laravel-notification-channels/twilio

Provides Twilio notification channel for Laravel

2587.7M12](/packages/laravel-notification-channels-twilio)[spatie/url-signer

Generate a url with an expiration date and signature to prevent unauthorized access

4422.3M16](/packages/spatie-url-signer)[mattketmo/email-checker

Throwaway email detection library

2742.0M5](/packages/mattketmo-email-checker)[laravel-notification-channels/discord

Laravel notification driver for Discord.

2371.3M11](/packages/laravel-notification-channels-discord)

PHPackages © 2026

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