diff --git a/src/Laracasts/Flash/FlashNotifier.php b/src/Laracasts/Flash/FlashNotifier.php index 2b85e08..155f53a 100644 --- a/src/Laracasts/Flash/FlashNotifier.php +++ b/src/Laracasts/Flash/FlashNotifier.php @@ -26,7 +26,7 @@ class FlashNotifier function __construct(SessionStore $session) { $this->session = $session; - $this->messages = collect(); + $this->messages = $session->get('flash_notification', collect()); } /** diff --git a/src/Laracasts/Flash/LaravelSessionStore.php b/src/Laracasts/Flash/LaravelSessionStore.php index ae3c051..2f1b455 100644 --- a/src/Laracasts/Flash/LaravelSessionStore.php +++ b/src/Laracasts/Flash/LaravelSessionStore.php @@ -31,4 +31,16 @@ public function flash($name, $data) { $this->session->flash($name, $data); } + + /** + * Get an item from the session. + * + * @param string $key + * @param mixed $default + * @return mixed + */ + public function get($key, $default = null) + { + return $this->session->get($key, $default); + } }