fix(flash): make flash messages one-shot per request
This commit is contained in:
@@ -318,6 +318,17 @@ if (Router::getTemplateView()) {
|
||||
);
|
||||
}
|
||||
|
||||
if (!$isApiRequest) {
|
||||
// Flash messages are consumed before Session::end() so one-shot removal
|
||||
// is persisted even though views are rendered afterwards.
|
||||
$flashScopes = [];
|
||||
$pathScope = Request::path();
|
||||
$pathWithQueryScope = Request::pathWithQuery();
|
||||
$flashScopes[$pathScope] = true;
|
||||
$flashScopes[$pathWithQueryScope] = true;
|
||||
$appFlashMessages = flashConsumeForScopes(array_keys($flashScopes));
|
||||
}
|
||||
|
||||
// ── 12. Session & DB close ──────────────────────────────────────────
|
||||
|
||||
Session::end();
|
||||
|
||||
Reference in New Issue
Block a user