Skip to content

Commit f2d4e25

Browse files
Merge pull request #2 from DevKingDigital/master
Fixed issue with driver not persisting across requests
2 parents 23ea3e4 + 5d55156 commit f2d4e25

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
},
2525
"require-dev": {
2626
"phpunit/phpunit": "4.8.*",
27-
"satooshi/php-coveralls": "dev-master"
27+
"satooshi/php-coveralls": "1.0.0"
2828
},
2929
"minimum-stability": "dev"
3030
}

src/Notifier.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public function __construct(TemplateParser $parser, Session $session, array $con
6666
public function notify($level, array $attributes = [])
6767
{
6868
if (isset($this->driver['levels'][$level])) {
69-
$this->notifications[] = array_merge(['level' => $this->driver['levels'][$level]], $attributes);
69+
$this->notifications[] = array_merge(['level' => $this->driver['levels'][$level], 'driver' => $this->driver], $attributes);
7070
$this->session->flash('notifications', $this->notifications);
7171

7272
return $this;
@@ -117,7 +117,9 @@ public function render()
117117
{
118118
if ($notifications = $this->session->get('notifications')) {
119119
foreach ($notifications as $key => $notification) {
120-
$notifications[$key] = $this->parser->parse($this->driver['template'], $notification);
120+
$driver = $notification['driver'];
121+
unset($notification['driver']);
122+
$notifications[$key] = $this->parser->parse($driver['template'], $notification);
121123
}
122124

123125
if ( ! empty($notifications)) {
@@ -214,4 +216,4 @@ function __toString()
214216
{
215217
return $this->render();
216218
}
217-
}
219+
}

0 commit comments

Comments
 (0)