Skip to content

Commit 0d889d2

Browse files
committed
patch: flash errors
1 parent 5ca5ea6 commit 0d889d2

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

Store.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -187,18 +187,19 @@ public function flash(string|array $key, mixed $value = true): void
187187
$this->setFlashdata($key, $value);
188188
}
189189

190-
public function flashErrors(array|string $errors, string $key = 'default'): void
190+
public function flashErrors(array|string $errors, string $key = 'default'): array
191191
{
192192
if (is_string($errors)) {
193193
$errors = [$key => $errors];
194194
}
195195

196196
$_errors = $this->getFlashdata('errors') ?? [];
197+
198+
$flashed = array_merge($_errors, $errors);
197199

198-
$this->flash(
199-
'errors',
200-
array_merge($_errors, $errors)
201-
);
200+
$this->flash('errors', $flashed);
201+
202+
return $flashed;
202203
}
203204

204205
/**

0 commit comments

Comments
 (0)