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

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

grimthorr/laravel-toast
=======================

Simple toast messages for Laravel 5.

1.1.2(7y ago)4572.4k19[2 issues](https://github.com/Grimthorr/laravel-toast/issues)[1 PRs](https://github.com/Grimthorr/laravel-toast/pulls)MITPHPPHP &gt;=5.4.0

Since Mar 9Pushed 3y ago1 watchersCompare

[ Source](https://github.com/Grimthorr/laravel-toast)[ Packagist](https://packagist.org/packages/grimthorr/laravel-toast)[ Docs](https://github.com/Grimthorr/laravel-toast)[ RSS](/packages/grimthorr-laravel-toast/feed)WikiDiscussions master Synced today

READMEChangelog (4)Dependencies (3)Versions (5)Used By (0)

laravel-toast
=============

[](#laravel-toast)

Simple toast messages for Laravel 5.

> **Warning**
>
> **This repository has been archived.** It is no longer maintained and can be considered abandoned. While it may work with later versions of Laravel, you should exercise caution while using it to avoid introducing any unexpected security risks.

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

[](#installation)

**1.** Run `composer require grimthorr/laravel-toast` to include this in your project.

**2.** *Optional, Laravel 5.4 and below*: Add `'Grimthorr\LaravelToast\ServiceProvider'` to `providers` in `config/app.php`, and add `'Toast' => 'Grimthorr\LaravelToast\Facade'` to `aliases` in `config/app.php`.

```
// config/app.php
'providers' => array(
  // ...
  'Grimthorr\LaravelToast\ServiceProvider',
),
// ...
'aliases' => array(
  // ...
  'Toast' => 'Grimthorr\LaravelToast\Facade',
),
```

**3.** Include `@include('toast::messages')` or `@include('toast::messages-jquery')` somewhere in your template.

**4.** *Optional*: Run `php artisan vendor:publish --provider="Grimthorr\LaravelToast\ServiceProvider" --tag="config"` to publish the config file.

**5.** *Optional*: Modify the published configuration file located at `config/laravel-toast.php` to your liking.

**6.** *Optional*: Run `php artisan vendor:publish --provider="Grimthorr\LaravelToast\ServiceProvider" --tag="views"` to publish the views.

**7.** *Optional*: Modify the published views located at `resources/views/vendor/toast` to your liking.

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

[](#configuration)

Pop open `config/laravel-toast.php` to adjust package configuration. If this file doesn't exist, run `php artisan vendor:publish --provider="Grimthorr\LaravelToast\ServiceProvider" --tag="config"` to create the default configuration file.

```
return array(
  'levels' => array(
    'info' => 'info',
    'success' => 'success',
    'error' => 'error',
    'warning' => 'warning',
    'default' => 'info'
  ),
);
```

#### Levels

[](#levels)

Specify the class sent to the view for each level. For example calling the `info` method would send the `info` class to the view. If you use [Bootstrap](http://getbootstrap.com/), you could set this to `alert alert-info` for ease of use in the view.

You can create a custom method here by passing a new level name and class. For example: `'help' => 'help'` will allow you to call `Toast::help($message)`. Alternatively, you can use the `Toast::message($message, $level)` method instead.

#### Views

[](#views)

This package includes a couple of views to get you started, they can be published to your resources directory using `php artisan vendor:publish --provider="Grimthorr\LaravelToast\ServiceProvider" --tag="views"` or called straight from the package by including them in a Blade template: `@include('toast::messages')`.

```
@if(Session::has('toasts'))
  @foreach(Session::get('toasts') as $toast)

      &times;

      {{ $toast['message'] }}

  @endforeach
@endif
```

Usage
-----

[](#usage)

Use the Toast facade (`Toast::`) or the helper function (`toast()->`) to access the methods in this package. You can also chain multiple messages together using method chaining: `toast()->success('done')->info('hello')`. The `title` argument is optional.

#### Message

[](#message)

```
Toast::message('message', 'level', 'title');
toast()->message('message', 'level', 'title');
toast('message', 'title');
```

Add a toast to the session. Using `toast('message')` will use the default level.

#### Info

[](#info)

```
Toast::info('message', 'title');
toast()->info('message', 'title');
```

Add a toast with the `info` level.

#### Success

[](#success)

```
Toast::success('message', 'title');
toast()->success('message', 'title');
```

Add a toast with the `success` level.

#### Error

[](#error)

```
Toast::error('message', 'title');
toast()->error('message', 'title');
```

Add a toast with the `error` level.

#### Warning

[](#warning)

```
Toast::warning('message', 'title');
toast()->warning('message', 'title');
```

Add a toast with the `warning` level.

#### Clear

[](#clear)

```
Toast::clear();
toast()->clear();
```

Remove all pending toast messages from the session.

Example
-------

[](#example)

These examples are using the default configuration.

#### Using the facade to send an error message

[](#using-the-facade-to-send-an-error-message)

The following adds an error toast to the session and then redirects to `home`.

```
// Create the message
Toast::error('oops');

// Return a HTTP response to initiate the new session
return Redirect::to('home');
```

#### Using method chaining to create multiple toasts

[](#using-method-chaining-to-create-multiple-toasts)

The following adds an error and info toast to the session and then redirects to `home`.

```
// Create the message
Toast::error('oops')
  ->info('hello');

// Return a HTTP response to initiate the new session
return Redirect::to('home');
```

#### Using the helper function to send a message with a title

[](#using-the-helper-function-to-send-a-message-with-a-title)

The following adds a toast to the session and then redirects to `home`.

```
// Create the message
toast('example', 'title goes here');

// Return a HTTP response to initiate the new session
return Redirect::to('home');
```

#### Using the helper function to send a message with a custom level

[](#using-the-helper-function-to-send-a-message-with-a-custom-level)

The following adds a help toast to the session and then redirects to `home`.

```
// Create the message
toast()->message('example', 'help');

// Return a HTTP response to initiate the new session
return Redirect::to('home');
```

Finally
-------

[](#finally)

#### Contributing

[](#contributing)

Feel free to create a fork and submit a pull request if you would like to contribute.

#### Bug reports

[](#bug-reports)

Raise an issue on GitHub if you notice something broken.

#### Credits

[](#credits)

Based loosely on .

###  Health Score

38

—

LowBetter than 83% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity40

Moderate usage in the ecosystem

Community17

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 68.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 ~430 days

Total

4

Last Release

2844d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2590044324102901188e55c447ac1d45d4ce799108c1393eabdf7fef02dea834?d=identicon)[Grimthorr](/maintainers/Grimthorr)

---

Top Contributors

[![Grimthorr](https://avatars.githubusercontent.com/u/5190473?v=4)](https://github.com/Grimthorr "Grimthorr (11 commits)")[![rzimin](https://avatars.githubusercontent.com/u/2657639?v=4)](https://github.com/rzimin "rzimin (2 commits)")[![lukeramsden](https://avatars.githubusercontent.com/u/13789719?v=4)](https://github.com/lukeramsden "lukeramsden (1 commits)")[![piperone](https://avatars.githubusercontent.com/u/351744?v=4)](https://github.com/piperone "piperone (1 commits)")[![tiagozini](https://avatars.githubusercontent.com/u/2147985?v=4)](https://github.com/tiagozini "tiagozini (1 commits)")

### Embed Badge

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

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

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[mike-bronner/laravel-model-caching

Automatic caching for Eloquent models.

2.4k91.9k1](/packages/mike-bronner-laravel-model-caching)[api-platform/laravel

API Platform support for Laravel

58171.6k14](/packages/api-platform-laravel)[flarum/core

Delightfully simple forum software.

201.4M2.3k](/packages/flarum-core)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)

PHPackages © 2026

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