PHPackages                             godforhire/toast - 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. godforhire/toast

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

godforhire/toast
================

Easy toast notifications

1.02(3y ago)273MITPHPPHP &gt;=5.4.0

Since Jul 24Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/godforhire/toast)[ Packagist](https://packagist.org/packages/godforhire/toast)[ RSS](/packages/godforhire-toast/feed)WikiDiscussions master Synced 5d ago

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

Easy toast notifications for your Laravel apps
==============================================

[](#easy-toast-notifications-for-your-laravel-apps)

This composer package offers **Bootstrap 5** toast notifications and modals for your Laravel applications.

---

*This package is derived from laracasts/flash*

---

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

[](#installation)

Begin by pulling in the package through Composer.

```
composer require godforhire/toast
```

Usage
-----

[](#usage)

Within your controllers, before you perform a redirect, make a call to the `toast()` function.

```
public function store()
{
    toast('Toast message!');

    return home();
}
```

Toast themes follow the Bootstrap contextual classes:

- `toast('Toast message')->info()`: Set the toast theme to "info"
- `toast('Toast message')->success()`: Set the toast theme to "success"
- `toast('Toast message')->warning()`: Set the toast theme to "warning"
- `toast('Toast message')->danger()`: Set the toast theme to "danger"

If no class is passed, the default is set to "info".

Except for overlays, toast messages are automatically dismissed after 5 seconds, but if you wish to change this, use the delay method:

- `toast('Message')->danger()->delay(10000)`

Add `important()` to manually dismiss a toast message:

- `toast('Message')->danger()->important()`

To render the message as an overlay/modal, use:

- `toast('Toast message')->overlay()`

You can also add a title:

- `toast()->overlay('Modal Message', 'Modal Title')`

With this message toasted to the session, you may now display it in your view(s). Because toast messages and overlays are so common, we provide a template out of the box to get you started. You're free to use - and even modify to your needs - this template how you see fit.

```
@include('toast::message')
```

In your application template, add the following code to toggle the toast messages/modal:

```
    $('.toast-overlay-modal').modal('show');
    $('.toast').toast('show');
```

If you need to modify the toast message partials, you can run:

```
php artisan vendor:publish --provider="godforhire\Toast\ToastServiceProvider"
```

Please refer to the official Bootstrap 5 documentation for positioning the toast messages:

The two package views will now be located in the `resources/views/vendor/toast/` directory.

Multiple Toast Messages
-----------------------

[](#multiple-toast-messages)

Need to toast multiple toast messages to the session? No problem.

```
toast('Toast message 1')->info();
toast('Toast message 2')->warning()->important();
toast('Toast message 3')->warning()->important();

return redirect('somewhere');
```

You'll now see three toast messages upon redirect.

You can also mix in an overlay to display both:

```
toast('Toast message 1')->info();
toast()->overlay('Toast message', 'Notice')->important();

return redirect('somewhere');
```

If you redirect to another controller and create toast message there, it will be appended to the collection.

Multiple Modal Messages
-----------------------

[](#multiple-modal-messages)

While it is possible to display multiple modals, they will be stacked on top of each other. This will also result in multiple background overlays, causing the background to increase in darkness with each modal.

###  Health Score

35

—

LowBetter than 79% of packages

Maintenance59

Moderate activity, may be stable

Popularity11

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity52

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.

###  Release Activity

Cadence

Every ~212 days

Recently: every ~302 days

Total

9

Last Release

55d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/396a5af37597be0f8b2ebb96f2319162962d484ed5a398b3da622cb690a55da2?d=identicon)[godforhire](/maintainers/godforhire)

---

Top Contributors

[![godforhire](https://avatars.githubusercontent.com/u/1974013?v=4)](https://github.com/godforhire "godforhire (12 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/godforhire-toast/health.svg)

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

###  Alternatives

[barryvdh/laravel-ide-helper

Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.

14.9k123.0M687](/packages/barryvdh-laravel-ide-helper)[orchestra/canvas

Code Generators for Laravel Applications and Packages

21017.2M158](/packages/orchestra-canvas)[illuminate/pipeline

The Illuminate Pipeline package.

9446.6M213](/packages/illuminate-pipeline)[illuminate/pagination

The Illuminate Pagination package.

10532.5M862](/packages/illuminate-pagination)[spatie/laravel-pjax

A pjax middleware for Laravel 5

513371.8k11](/packages/spatie-laravel-pjax)[spatie/laravel-mix-preload

Add preload and prefetch links based your Mix manifest

169176.0k2](/packages/spatie-laravel-mix-preload)

PHPackages © 2026

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