Skip to content

Commit

Permalink
Merge branch '3.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
crynobone committed Jul 4, 2015
2 parents 95d8ac2 + 4ad25e7 commit bc0b470
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ Add `Orchestra\Messages\MessagesServiceProvider` service provider in `config/app

// ...

'Orchestra\Messages\MessagesServiceProvider',
Orchestra\Messages\MessagesServiceProvider::class,
],
```

Expand All @@ -73,7 +73,7 @@ You might want to add `Orchestra\Support\Facades\Messages` to class aliases in `

// ...

'Messages' => 'Orchestra\Support\Facades\Messages',
'Messages' => Orchestra\Support\Facades\Messages::class,
],
```

Expand Down Expand Up @@ -114,11 +114,10 @@ Here's an example how you can display the message:
$message = Messages::retrieve();

if ($message instanceof Orchestra\Messages\MessageBag) {
$message->setFormat('<div class="alert alert-:key">:message</div>');

foreach (['error', 'info', 'success'] as $key) {
if ($message->has($key)) {
$message->setFormat(
'<div class="alert alert-'.$key.'">:message</div>'
);
echo implode('', $message->get($key));
}
}
Expand Down
3 changes: 1 addition & 2 deletions src/Http/Middleware/StoreMessageBag.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

class StoreMessageBag
{
/**
/**
* The application implementation.
*
* @var \Illuminate\Contracts\Foundation\Application
Expand Down Expand Up @@ -38,4 +38,3 @@ public function handle($request, Closure $next)
return $response;
}
}

4 changes: 2 additions & 2 deletions src/helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
* Add a message to the bag.
*
* @param string $key
* @param string $message
* @param string|callable $message
*
* @return \Orchestra\Messages\MessageBag
*/
function messages($key, $message)
{
return app('orchestra.messages')->add($key, $message);
return app('orchestra.messages')->add($key, value($message));
}
}

0 comments on commit bc0b470

Please sign in to comment.