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

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

retinens/laravel-toastr
=======================

This package provides an easy interface for using toastr.js in a Laravel app.

v1.2.0(1y ago)01.6k[2 issues](https://github.com/retinens/laravel-toastr/issues)[3 PRs](https://github.com/retinens/laravel-toastr/pulls)MITPHPPHP ^8.1|^8.2CI passing

Since Nov 21Pushed 3w ago1 watchersCompare

[ Source](https://github.com/retinens/laravel-toastr)[ Packagist](https://packagist.org/packages/retinens/laravel-toastr)[ Docs](https://github.com/retinens/laravel-toastr)[ RSS](/packages/retinens-laravel-toastr/feed)WikiDiscussions main Synced 3w ago

READMEChangelog (3)Dependencies (13)Versions (7)Used By (0)

Bootstrap 5 flash messages for your Laravel app
===============================================

[](#bootstrap-5-flash-messages-for-your-laravel-app)

[![Latest Version on Packagist](https://camo.githubusercontent.com/e098acaf88a421d174ca79e36d66af5f1a3e8bdad3af593864d6dc0000749098/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f726574696e656e732f6c61726176656c2d746f617374722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/retinens/laravel-toastr)[![GitHub Tests Action Status](https://camo.githubusercontent.com/fdf9f717bc4e5777f6d524de697ac30d975abb0ae4d9ff740849537b37617c33/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f726574696e656e732f6c61726176656c2d746f617374722f72756e2d74657374733f6c6162656c3d7465737473)](https://github.com/retinens/laravel-toastr/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/4f19ab1ea48770f924124e993e22389311a4d7bea24b6194fd32c37b17800c11/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f726574696e656e732f6c61726176656c2d746f617374722f436865636b253230262532306669782532307374796c696e673f6c6162656c3d636f64652532307374796c65)](https://github.com/retinens/laravel-toastr/actions?query=workflow%3A%22Check+%26+fix+styling%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/0f427642518cb1a41b9c75642984d2accabad72fb2f688a92c03bbb4d39fa3ff/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f726574696e656e732f6c61726176656c2d746f617374722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/retinens/laravel-toastr)

This package provides an easy interface for using Toastr.js messages in your Laravel app.

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

[](#installation)

You can install the package via composer:

```
composer require retinens/laravel-toastr
```

You can publish the config file with:

```
php artisan vendor:publish --tag="laravel-toastr-config"
```

This is the contents of the published config file:

```
return [
    /*
     * Defines the default auto_hide parameter
     */
    'auto_hide' => false,

    /*
     * Defines the position of the toast on the window
     */

    // "top" or "bottom"
    "position_y" => 'bottom',
    // "start" or "end"
    "position_x" => 'end',
];
```

Optionally, you can publish the views using

```
php artisan vendor:publish --tag="laravel-toastr-views"
```

Usage
-----

[](#usage)

Toastr should be imported in your assets and available in the window variable.

For example, in your `app.js` file:

```
import * as toastr from 'toastr'
window.toastr = toastr
```

```
@import '~toastr/build/toastr.scss';
```

Include the component in your blade base template, after all the scripts.

```

```

Then, in your controller, call the `toastr()` method to create a toast message.

```
public function update()
{
    //do stuff
    toastr('Post edited!');
    return redirect(route('posts.index'));
}
```

The toast method accepts the title and level as optional arguments :

```
toastr('message','level','title')
```

There are a few quick methods to modify the toast:

- `toastr()->success('Message')`: Set the toast level as "success".
- `toastr()->info('Message')`: Set the toast level as "info".
- `toastr()->error('Message')`: Set the toast level as "danger".
- `toastr()->warning('Message')`: Set the toast level as "warning".
- `toastr()->title('Message',"Toast title")`: Set the toast title.

Changelog
---------

[](#changelog)

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

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

[](#security-vulnerabilities)

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

Credits
-------

[](#credits)

- [Lucas Houssa](https://github.com/WhereIsLucas)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

42

—

FairBetter than 89% of packages

Maintenance67

Regular maintenance activity

Popularity15

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 58.8% 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 ~239 days

Total

3

Last Release

718d ago

### Community

Maintainers

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

---

Top Contributors

[![WhereIsLucas](https://avatars.githubusercontent.com/u/25830895?v=4)](https://github.com/WhereIsLucas "WhereIsLucas (20 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (7 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (7 commits)")

---

Tags

laravellaravel-toastrretinens

###  Code Quality

TestsPest

Code StylePHP CS Fixer

### Embed Badge

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

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

###  Alternatives

[spatie/laravel-data

Create unified resources and data transfer objects

1.8k33.0M880](/packages/spatie-laravel-data)[spatie/laravel-pdf

Create PDFs in Laravel apps

1.0k4.3M42](/packages/spatie-laravel-pdf)[codewithdennis/filament-select-tree

The multi-level select field enables you to make single selections from a predefined list of options that are organized into multiple levels or depths.

328482.0k25](/packages/codewithdennis-filament-select-tree)[nativephp/desktop

NativePHP for Desktop

38133.6k8](/packages/nativephp-desktop)[worksome/exchange

Check Exchange Rates for any currency in Laravel.

124581.3k](/packages/worksome-exchange)[rawilk/profile-filament-plugin

Profile &amp; MFA starter kit for filament.

3913.7k](/packages/rawilk-profile-filament-plugin)

PHPackages © 2026

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