controller(true); $action = $request->action(true); $path = $controller . '/' . $action; $user = null; if ($uid = Session::get('uid')) { $user = Users::get($uid); } if (!in_array($path, $this->paths) && !$user) { return redirect(url('/auth/login')); } $request->user = $user; return $next($request); } }