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

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

palpalani/laravel-toastr
========================

Implements toastr.js for Laravel projects

0.4.0(1y ago)324.1k—0%2MITPHPPHP ^8.2CI passing

Since Mar 5Pushed 1mo ago1 watchersCompare

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

READMEChangelog (10)Dependencies (6)Versions (16)Used By (0)

Laravel Toastr
==============

[](#laravel-toastr)

[![Latest Version on Packagist](https://camo.githubusercontent.com/152fe1fb7eb442c1217b3e1a44e5344b5b7cc39f710ae2cf46b1bc1662528664/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f70616c70616c616e692f6c61726176656c2d746f617374722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/palpalani/laravel-toastr)[![GitHub Tests Action Status](https://camo.githubusercontent.com/9dfdf78691b63b4735cf295f62baaf67568feb03408d8942aa7d6ae403758e9b/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f70616c70616c616e692f6c61726176656c2d746f617374722f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/palpalani/laravel-toastr/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/b6934b9c7864d4aa1ca345ccaea316709fb367a737d80b3c65c8815c086e96a7/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f70616c70616c616e692f6c61726176656c2d746f617374722f7068702d63732d66697865722e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/palpalani/laravel-toastr/actions?query=workflow%3A%22Check+&+fix+styling%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/db3aaa66b46dc619d4ef635e3778ed5f78c3b3a7cac87ed6cddf74bf81abba43/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f70616c70616c616e692f6c61726176656c2d746f617374722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/palpalani/laravel-toastr)

Implements toastr.js for Laravel. Toastr.js is a Javascript library for non-blocking notifications.

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

[](#installation)

### NPM

[](#npm)

To install a plugin via npm run

```
npm install toastr

```

### Composer

[](#composer)

You can also install the package via composer:

```
composer require palpalani/laravel-toastr

```

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

[](#configuration)

Publish the config file with

```
php artisan vendor:publish --provider="palPalani\Toastr\ToastrServiceProvider" --tag="laravel-toastr-config"

```

This is the contents of the published config file:

```
return [
    'options' => [
        "progressBar" => true,
        "positionClass" =>"toast-bottom-right",
        "preventDuplicates"=> false,
        "showDuration" => 300,
        "hideDuration" => 1000,
        "timeOut" => 5000,
        "extendedTimeOut" => 1000,
        "showEasing" => "swing",
        "hideEasing"=> "linear",
        "showMethod" => "fadeIn",
        "hideMethod" => "fadeOut",
    ]
];
```

If you want, edit `config/toastr.php` and set the `options` array to whatever you want to pass to Toastr (this step is optional). These options are set as the default options and can be overridden by passing an array of options to any of the methods in the **Usage** section.

Usage
-----

[](#usage)

Include jQuery, [toastr.js](http://codeseven.github.io/toastr/) and plugin styles in your master view template.

Link to toastr.min.css:

```

```

Link to toastr.min.js:

```

```

After everything is done, insert the string below in your template just before body closing tag or after toastr.js script instantiated in your file.

```
{!! Toastr::render() !!}
```

Then use these methods in your controllers to insert a toast:

- `Toastr::warning($message, $title = null, $options = [])` - add a warning toast
- `Toastr::error($message, $title = null, $options = [])` - add an error toast
- `Toastr::info($message, $title = null, $options = [])` - add an info toast
- `Toastr::success($message, $title = null, $options = [])` - add a success toast
- `Toastr::add($type: warning|error|info|success, $message, $title = null, $options = [])` - add a toast
- **`Toastr::clear()` - clear all current toasts** don't forget to use it

For a list of available options, see [toastr.js' documentation](http://codeseven.github.io/toastr/demo.html).

Testing
-------

[](#testing)

```
composer test

```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](.github/CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Versioning
----------

[](#versioning)

We use [SemVer](http://semver.org/) for versioning. For the versions available, see the [tags on this repository](https://github.com/palpalani/laravel-toastr/tags).

Credits
-------

[](#credits)

- [palPalani](https://github.com/palPalani)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

47

—

FairBetter than 94% of packages

Maintenance71

Regular maintenance activity

Popularity29

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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

Recently: every ~270 days

Total

12

Last Release

436d ago

PHP version history (4 changes)0.1.0PHP ^7.2|^8.0

0.2.0PHP ^7.3|^8.0

0.2.5PHP ^8.0

0.3.0PHP ^8.2

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/716695?v=4)[Palaniappan P](/maintainers/palpalani)[@palpalani](https://github.com/palpalani)

---

Top Contributors

[![palpalani](https://avatars.githubusercontent.com/u/716695?v=4)](https://github.com/palpalani "palpalani (65 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (48 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (36 commits)")[![loglinn05](https://avatars.githubusercontent.com/u/78077184?v=4)](https://github.com/loglinn05 "loglinn05 (1 commits)")

---

Tags

laravellaravel-packagelaravel-toastrnotificationsphplaravelnotificationtoastrlaravel-toastrpalpalani

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[brian2694/laravel-toastr

toastr.js for Laravel

136649.4k5](/packages/brian2694-laravel-toastr)[mckenziearts/laravel-notify

Flexible flash notifications for Laravel

1.7k1.1M5](/packages/mckenziearts-laravel-notify)[oriceon/toastr-5-laravel

Easy toastr notifications for Laravel 5

92473.5k3](/packages/oriceon-toastr-5-laravel)[helmesvs/laravel-notify

Elegant notifications to laravel with Toastr or PNotify

6127.3k](/packages/helmesvs-laravel-notify)[ladumor/one-signal

Laravel Wrapper for OneSignal.

125331.3k](/packages/ladumor-one-signal)[gr8shivam/laravel-sms-api

A modern, flexible Laravel package for integrating any SMS gateway with REST API support

10138.4k](/packages/gr8shivam-laravel-sms-api)

PHPackages © 2026

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