PHPackages                             royvoetman/laravel-flash-alerts - 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. royvoetman/laravel-flash-alerts

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

royvoetman/laravel-flash-alerts
===============================

Automatically flash success alerts in resources controllers: `store`, `update` and `destroy` methods.

v1.0.6(3y ago)425MITPHPPHP ^7.0 || ^8.0

Since Aug 15Pushed 3y ago1 watchersCompare

[ Source](https://github.com/RoyVoetman/Laravel-Flash-Alerts)[ Packagist](https://packagist.org/packages/royvoetman/laravel-flash-alerts)[ RSS](/packages/royvoetman-laravel-flash-alerts/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (7)Dependencies (1)Versions (8)Used By (0)

Laravel Flash Alerts
====================

[](#laravel-flash-alerts)

This packages will automatically flash success messages to the session when a controller's: `store`, `update` or `destroy` method was successfully executed.

An execution is considered successful when no exceptions were raised and no messages are defined in the current session under the key `warning`.

[![Latest Version](https://camo.githubusercontent.com/b0f0cce747c457412d7c82c480f45111656d55eefcd1638bf1d721a2f0d66a96/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f726f79766f65746d616e2f6c61726176656c2d666c6173682d616c657274732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/royvoetman/laravel-flash-alerts)[![MIT Licensed](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE)[![Total Downloads](https://camo.githubusercontent.com/b401b9029c2c021474491d4fa43c959c9e3db36084a8c37ae607040ca0220e55/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f726f79766f65746d616e2f6c61726176656c2d666c6173682d616c657274732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/royvoetman/laravel-flash-alerts)

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

[](#installation)

```
composer require royvoetman/laravel-flash-alerts
```

Add FlashAlerts middleware to the routeMiddleware array in app/Http/Kernel.php

```
 /**
  * The application's route middleware.
  *
  * These middleware may be assigned to groups or used individually.
  *
  * @var array
  */
 protected $routeMiddleware = [
    ...
    'flash.alerts' => \RoyVoetman\LaravelFlashAlerts\Middleware\FlashAlerts::class
 ];
```

Add the FlashesAlerts trait to your applications BaseController

```
