mnshankar/flashmessenger
Larablocks Analysis
mnshankar/flashmessenger works with Laravel 4 (latest release 1.1, Jun 17, 2015), which reached end of life: no more fixes, even for security.
Recommendation checks
Not advisedNot advised: no release or commit in over 2 years.
- No release or commit in over 2 years
- Supports only Laravel 4, past end of life
- No release in the last 12 months (last: Jun 17, 2015)
- 0 downloads a month (needs 10,000)
- 0 GitHub stars (needs 100)
State
Likely abandoned- No release or commit in over 2 years.
- Last stable release: Jun 17, 2015.
- No releases in the last 12 months.
- First released: Feb 25, 2015.
- 0 open issues on GitHub.
Data from Packagist and GitHub, checked by Larablocks on Dec 2, 2026.
| Install | |
|---|---|
composer require mnshankar/flashmessenger |
|
| Latest Version: | 1.1 |
| PHP: | >=5.3.0 |
| Laravel: | 4 |
| License: | MIT |
| Last Updated: | Jun 17, 2015 |
| Links: | GitHub · Packagist |
Easy Flash Messages
Installation
First, pull in the package through Composer.
"require": {
"mnshankar/flashmessenger": "1.1"
}
And then, if using Laravel, include the service provider within app/config/app.php.
'providers' => array(
'mnshankar\Flash\FlashServiceProvider'
);
And, for convenience, add a facade alias to this same file at the bottom:
'aliases' => array(
'Flash' => 'mnshankar\Flash\Flash'
);
Usage
Within your controllers, before you perform a redirect...
public function store()
{
Flash::message('Welcome Aboard!');
return Redirect::home();
}
You may also do:
- 'Flash::info('Message')`
Flash::success('Message')Flash::error('Message')Flash::warning('Message')Flash::overlay('Modal Message', 'Modal Title')
Again, if using Laravel, this will set three keys in the session:
- 'flash_notification.message' - The message you're flashing
- 'flash_notification.level' - A string that represents the type of notification (good for applying HTML class names)
With this message flashed to the session, you may now display it in your view(s). Maybe something like:
@if (Session::has('flash_notification.message'))
<div class="alert alert-{{ Session::get('flash_notification.level') }}">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
{{ Session::get('flash_notification.message') }}
</div>
@endif
Note that this package is optimized for use with Twitter Bootstrap.
Because flash messages and overlays are so common, if you want, you may use (or modify) the views that are included with this package. Simply append to your layout view:
@include('flashmessenger::message')
Example
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
</head>
<body>
<div class="container">
@include('flashmessenger::message')
<p>Welcome to my website...</p>
</div>
<script src="//code.jquery.com/jquery.js"></script>
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
<!-- This is only necessary if you do Flash::overlay('...') -->
<script>
$('#flash-overlay-modal').modal();
</script>
</body>
</html>
If you need to modify the flash message partials, you can run:
php artisan view:publish mnshankar/flashmessenger
The two package views will now be located in the `app/views/packages/mnshankar/flashmessenger/' directory.
Credits
This is almost a verbatim copy of Jeffrey Way's Flash library (https://github.com/laracasts/flash) .. I just tweaked it (very slightly) so I can use it with php 5.3.
Related Packages
Powerful PHP database abstraction layer (DBAL) with many features for database s...
Laravel Serializable Closure provides an easy and secure way to serialize closur...
Cli error handling for console/command-line PHP applications.
Version History
| Version | Released | PHP | Laravel | License |
|---|---|---|---|---|
| 1.1 | >=5.3.0 | ~4.0 | MIT | |
| 1.0 | >=5.3.0 | ~4.0 | MIT |
