From f111f32fa3cd08d04763df01743b689d1a4b39a8 Mon Sep 17 00:00:00 2001 From: drjonnicholson Date: Wed, 28 Sep 2016 20:36:33 +0100 Subject: [PATCH] Changed session()->put to session()->flash. This ensures the module information only stays for the duration of the request rather than for the duration of the session. This fixed an issue with having code outside of a module believing it's in a module --- src/Middleware/IdentifyModule.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Middleware/IdentifyModule.php b/src/Middleware/IdentifyModule.php index 0e978fca..ce68fbac 100644 --- a/src/Middleware/IdentifyModule.php +++ b/src/Middleware/IdentifyModule.php @@ -32,7 +32,7 @@ public function __construct(Modules $module) */ public function handle($request, Closure $next, $slug = null) { - $request->session()->put('module', $this->module->where('slug', $slug)); + $request->session()->flash('module', $this->module->where('slug', $slug)); return $next($request); }