Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/AtomClock/flash
Browse files Browse the repository at this point in the history
  • Loading branch information
Maxime Dupaul committed Apr 15, 2016
2 parents cb28317 + 5734fdb commit 69335f9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 63 deletions.
64 changes: 2 additions & 62 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
* Forked at first from Laracasts/Flash to port it to Laravel 5.2
* Forked at first from Laracasts/Flash to use multiple message

# Easy Flash Messages

## Installation
Expand Down Expand Up @@ -89,66 +90,5 @@ Because flash messages and overlays are so common, if you want, you may use (or
@include('flash::message')
```

## Example

```html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
</head>
<body>

<div class="container">
@include('flash::message')

<p>Welcome to my website...</p>
</div>

<script src="//code.jquery.com/jquery.js"></script>
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.5/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:

```bash
php artisan vendor:publish
```

The two package views will now be located in the `app/views/packages/laracasts/flash/` directory.

```php
Flash::message('Welcome aboard!');

return Redirect::home();
```

![https://dl.dropboxusercontent.com/u/774859/GitHub-Repos/flash/message.png](https://dl.dropboxusercontent.com/u/774859/GitHub-Repos/flash/message.png)

```php
Flash::error('Sorry! Please try again.');

return Redirect::home();
```

![https://dl.dropboxusercontent.com/u/774859/GitHub-Repos/flash/error.png](https://dl.dropboxusercontent.com/u/774859/GitHub-Repos/flash/error.png)

```php
Flash::overlay('You are now a Laracasts member!');

return Redirect::home();
```

![https://dl.dropboxusercontent.com/u/774859/GitHub-Repos/flash/overlay.png](https://dl.dropboxusercontent.com/u/774859/GitHub-Repos/flash/overlay.png)

> [Learn exactly how to build this very package on Laracasts!](https://laracasts.com/lessons/flexible-flash-messages)
2 changes: 1 addition & 1 deletion src/Mdupaul/Flash/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Arrange for a flash message.
*
* @param string|null $message
* @return \Laracasts\Flash\FlashNotifier
* @return \Mdupaul\Flash\FlashNotifier
*/
function flash($message = null)
{
Expand Down

0 comments on commit 69335f9

Please sign in to comment.