title: Can I get current route information in middleware with Lumen?
body: <p>I need to have the current found controller and action in a middleware, so that I can do some authentication. But I found it impossible, because the pipe is like Middleware1 -> Middleware2-> do the dispatching -> controller@action() -> Middleware2 -> Middleware1. </p>
  
  <p>Therefore before the dispatching, I cannot get the route info. It is definitely not right to do it after the $controller->action(). </p>
  
  <p>I did some research and found this.</p>
  
  <pre><code>$allRoutes = $this-&gt;app-&gt;getRoutes();
  $method = \Request::getMethod();
  $pathInfo = \Request::getPathInfo();
  $currentRoute = $allRoutes[$method.$pathInfo]['action']['uses'];
  </code></pre>
  
  <p>But this does not work when visiting URI like <code>app/role/1</code>, because <code>$allRoutes</code> only have index of <code>app/role/{id}</code> instead of <code>app/role/1</code>. </p>
  
  <p>Is there any workaround about this?</p>