PHPackages                             smodav/flash - 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. smodav/flash

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

smodav/flash
============

Flash messaging package for use with laravel

v1.0.1(9y ago)3262MITCSSPHP &gt;=5.4.0

Since Jun 16Pushed 9y ago1 watchersCompare

[ Source](https://github.com/SmoDav/flash)[ Packagist](https://packagist.org/packages/smodav/flash)[ RSS](/packages/smodav-flash/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (2)Versions (4)Used By (0)

Flash Notifier
==============

[](#flash-notifier)

[![Build Status](https://camo.githubusercontent.com/d12d3a5472edc72308893ce7dfd5e0ab7a713e5455a961c556be5ba6412bb265/68747470733a2f2f7472617669732d63692e6f72672f536d6f4461762f666c6173682e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/SmoDav/flash)[![Total Downloads](https://camo.githubusercontent.com/c5f87265b7cde668afb779c517b0ad384453d81cb6617c42a9fa6bb35047ed31/68747470733a2f2f706f7365722e707567782e6f72672f736d6f6461762f666c6173682f642f746f74616c2e737667)](https://packagist.org/packages/smodav/flash)[![Latest Stable Version](https://camo.githubusercontent.com/b5f9ecc48084a799ad9350bc350882650ebeecb51e874420a515561732524b51/68747470733a2f2f706f7365722e707567782e6f72672f736d6f6461762f666c6173682f762f737461626c652e737667)](https://packagist.org/packages/smodav/flash)[![Latest Unstable Version](https://camo.githubusercontent.com/175470119a447906c5c74238fe6ad9d96e980ce6e7eae71c48551f5c47610c7c/68747470733a2f2f706f7365722e707567782e6f72672f736d6f6461762f666c6173682f762f756e737461626c652e737667)](https://packagist.org/packages/smodav/flash)[![License](https://camo.githubusercontent.com/d8923c2dde2469d789073428cc66511be1aa8efa717f27b49a057bc275278182/68747470733a2f2f706f7365722e707567782e6f72672f736d6f6461762f666c6173682f6c6963656e73652e737667)](https://packagist.org/packages/smodav/flash)

This is a laravel package for displaying flash notifications that extends [Sweet Alert](http://t4t5.github.io/sweetalert/) and provides an extra custom notice notification on the top left.

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

[](#installation)

Pull in the package through Composer.

Run `composer require smodav/flash`

When using Laravel 5, include the service provider and its alias within your `config/app.php`.

```
'providers' => [
    SmoDav\Flash\FlashServiceProvider::class,
];

'aliases' => [
    'Flash' => SmoDav\Flash\Flash::class,
];
```

Publish the package specific assets and view using

```
php artisan vendor:publish
```

This will publish the flash view into `resources/views/vendor/smodav/flash/` directory and also its accompanying css and javascript files into their respective `resources/assets/` directory.

Usage
-----

[](#usage)

The package comes with a helper function `flash()` and its respective facade `Flash`. Within your controllers or closures, use either before a redirect:

```
public function delete()
{
    flash()->success('Users', 'Successfully banned user.');

    return redirect()->route('users.index');
}

// OR

public function delete()
{
    Flash::success('Users', 'Successfully banned user.');

    return redirect()->route('users.index');
}
```

If you would like the notification to persist till dismissed by the user, use the `persist()` method on the instance:

```
public function delete()
{
    Flash::success('Users', 'Successfully banned user.')->persist();

    return redirect()->route('users.index');
}
```

The package has allows you to send different types of flash alerts:

- `Flash::info('Title', 'Message')`
- `Flash::success('Title', 'Message')`
- `Flash::error('Title', 'Message')`
- `Flash::warning('Title', 'Message')`

All the above can be persisted using `persist()`.

An additional `notice()` is included that provides a notice on the top right edge, however, the notice cannot be persisted:

- `Flash::notice('Message')`

```
public function delete()
{
    Flash::notice('Successfully banned user.');

    return redirect()->route('users.index');
}
```

For a basic flash instance of type info, just use the flash helper function: `flash(Title, Message)`

When using Laravel, this package creates flash session keys:

**Alerts**

- `sf_title` containing the title of the flash message.
- `sf_message` containing the actual flash message.
- `sf_level` containing the level of flash message.
- `sf_persist` only present when persist is used.

**Notices**

- `sf_notice_message` containing the flash notice message.

Within your views, include the `flash` view and the corresponding css and javascript files. You may modify the flash view and add more functionality to the flash instances by passing the properties described in [Sweet Alert](http://t4t5.github.io/sweetalert/) to the `sflash` instance:

```
sflash({
    title: "{{ session('sf_title') }}",
    text: "{{ session('sf_message') }}",
    type: "{{ session('sf_level') }}",
    allowOutsideClick: true,
    confirmButtonText: "Okay Man",
    showConfirmButton: true
});

```

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity60

Established project with proven stability

 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 ~20 days

Total

3

Last Release

3580d ago

### Community

Maintainers

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

---

Top Contributors

[![SmoDav](https://avatars.githubusercontent.com/u/2639600?v=4)](https://github.com/SmoDav "SmoDav (13 commits)")

---

Tags

laravelflashalert

### Embed Badge

![Health badge](/badges/smodav-flash/health.svg)

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

###  Alternatives

[masmerise/livewire-toaster

Beautiful toast notifications for Laravel / Livewire.

505550.3k6](/packages/masmerise-livewire-toaster)[caffeinated/flash

Flash Messages for Laravel

4649.5k2](/packages/caffeinated-flash)[cartalyst/alerts

Alerts allows you to easily pass alert messages to your Laravel views.

3064.2k](/packages/cartalyst-alerts)

PHPackages © 2026

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