2017 © Pedro Peláez
 

library flashmessenger

Easy flash notifications for Laravel 4 and PHP-5.3

image

mnshankar/flashmessenger

Easy flash notifications for Laravel 4 and PHP-5.3

  • Wednesday, June 17, 2015
  • by mnshankar
  • Repository
  • 1 Watchers
  • 0 Stars
  • 103 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

Build Status, (*1)

Easy Flash Messages

Installation

First, pull in the package through Composer., (*2)

"require": {
    "mnshankar/flashmessenger": "1.1"
}

And then, if using Laravel, include the service provider within app/config/app.php., (*3)

'providers' => array(
    'mnshankar\Flash\FlashServiceProvider'
);

And, for convenience, add a facade alias to this same file at the bottom:, (*4)

'aliases' => array(
    'Flash' => 'mnshankar\Flash\Flash'
);

Usage

Within your controllers, before you perform a redirect..., (*5)

public function store()
{
    Flash::message('Welcome Aboard!');

    return Redirect::home();
}

You may also do:, (*6)

  • '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:, (*7)

  • '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:, (*8)

@if (Session::has('flash_notification.message'))


{{ Session::get('flash_notification.message') }}
@endif

Note that this package is optimized for use with Twitter Bootstrap., (*9)

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:, (*10)

@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>



@include('flashmessenger::message')

Welcome to my website..., (*11)

</body> </html>

If you need to modify the flash message partials, you can run:, (*12)

php artisan view:publish mnshankar/flashmessenger

The two package views will now be located in the `app/views/packages/mnshankar/flashmessenger/' directory., (*13)

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., (*14)

The Versions

17/06 2015

dev-master

9999999-dev

Easy flash notifications for Laravel 4 and PHP-5.3

  Sources   Download

MIT

The Requires

 

The Development Requires

by Shankar Manamalkav

17/06 2015

1.1

1.1.0.0

Easy flash notifications for Laravel 4 and PHP-5.3

  Sources   Download

MIT

The Requires

 

The Development Requires

by Shankar Manamalkav

25/02 2015

1.0

1.0.0.0

Easy flash notifications for Laravel 4 and PHP-5.3

  Sources   Download

MIT

The Requires

 

The Development Requires

by Shankar Manamalkav