Skip to content

Commit

Permalink
Ready for v1
Browse files Browse the repository at this point in the history
  • Loading branch information
Maxime Dupaul committed Apr 15, 2016
1 parent 97204ee commit fd87ff9
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/Mdupaul/Flash/FlashNotifier.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php namespace Mdupaul\Flash;

use Illuminate\Support\Facades\Session;

class FlashNotifier
{

Expand Down Expand Up @@ -97,8 +99,14 @@ public function overlay($message, $title = 'Notice')
*/
public function message($message, $level = 'info')
{
$this->session->flash('flash_notification.message', $message);
$this->session->flash('flash_notification.level', $level);

$messages = [];
if (Session::has('flash_notification.messages')) {
$messages = Session::get('flash_notification.messages');
}
$messages[] = [$level => $message];

$this->session->flash('flash_notification.messages', $messages);

return $this;
}
Expand Down

0 comments on commit fd87ff9

Please sign in to comment.