Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/laracasts/flash
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffreyWay committed Feb 1, 2015
2 parents 402dc7c + f3f24cf commit a2e237a
Showing 1 changed file with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ First, pull in the package through Composer.

```js
"require": {
"laracasts/flash": "~1.0"
"laracasts/flash": "~1.3"
}
```

And then, if using Laravel, include the service provider within `app/config/app.php`.
And then, if using Laravel 5, include the service provider within `app/config/app.php`.

```php
'providers' => [
Expand Down Expand Up @@ -47,11 +47,29 @@ You may also do:
- `Flash::warning('Message')`
- `Flash::overlay('Modal Message', 'Modal Title')`

Again, if using Laravel, this will set three keys in the session:
Again, if using Laravel, this will set a few 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)

Alternatively, again, if you're using Laravel, you may reference the `flash()` helper function, instead of the facade. Here's an example:

```
/**
* Destroy the user's session (logout).
*
* @return Response
*/
public function destroy()
{
Auth::logout();
flash()->info('You have been logged out.');
return home();
}
```

With this message flashed to the session, you may now display it in your view(s). Maybe something like:

```html
Expand Down

0 comments on commit a2e237a

Please sign in to comment.