title: Get current route action name from middleware in laravel 5
body: <p>I have a middleware like this:</p>
  
  <pre><code>&lt;?php
  namespace App\Http\Middleware;
  
  use App\Contracts\PermissionsHandlerInterface;
  use Closure;
  
  class PermissionsHanlderMiddleware {
  
      public $permissionsHandler;
  
      function __construct(PermissionsHandlerInterface $permissionsHandler) {
          $this -&gt; permissionsHandler = $permissionsHandler;
      }
  
      /**
       * Handle an incoming request.
       *
       * @param  \Illuminate\Http\Request  $request
       * @param  \Closure  $next
       * @return mixed
       */
      public function handle($request, Closure $next) {
          $routeAction = $request-&gt;route()-&gt;getActionName();
  
          /*
           do some operations
          */
  
          return $next($request);
      }
  
  }
  </code></pre>
  
  <p>but <code>$request-&gt;route()</code> always returns <code>null</code>, I think its because the router hasn't been dispatched with the request.</p>
  
  <p><strong>Note:</strong> I added my middleware to <code>Kernal.php</code> global middlewares to run before each request as the following</p>
  
  <pre><code>protected $middleware = [
          .
          .
          .
          'App\Http\Middleware\PermissionsHanlderMiddleware',
      ];
  </code></pre>
  
  <p>I want to get route action name before the execution of <code>$next($request)</code> to do some permission operations. How can i do this ?</p>