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

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

rexlmanu/laravel-toast
======================

Simple toast messages for Laravel.

1.1.3(6y ago)04MITPHPPHP &gt;=5.4.0

Since Mar 9Pushed 6y agoCompare

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

READMEChangelog (1)Dependencies (3)Versions (6)Used By (0)

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

[](#laravel-toast)

Simple toast messages for Laravel.

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

[](#installation)

**1.** Run `composer require rexlmanu/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

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 66.7% 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 ~458 days

Total

5

Last Release

2248d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/32296940?v=4)[Emmanuel Lampe](/maintainers/rexlManu)[@rexlManu](https://github.com/rexlManu)

---

Top Contributors

[![Grimthorr](https://avatars.githubusercontent.com/u/5190473?v=4)](https://github.com/Grimthorr "Grimthorr (10 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/rexlmanu-laravel-toast/health.svg)

```
[![Health](https://phpackages.com/badges/rexlmanu-laravel-toast/health.svg)](https://phpackages.com/packages/rexlmanu-laravel-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)[psalm/plugin-laravel

Psalm plugin for Laravel

3274.9M308](/packages/psalm-plugin-laravel)[orchestra/canvas

Code Generators for Laravel Applications and Packages

21017.2M158](/packages/orchestra-canvas)[aedart/athenaeum

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

245.2k](/packages/aedart-athenaeum)[flarum/core

Delightfully simple forum software.

211.3M1.9k](/packages/flarum-core)[kirschbaum-development/commentions

A package to allow you to create comments, tag users and more

12369.2k](/packages/kirschbaum-development-commentions)

PHPackages © 2026

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