title: Pass complex parameter to route middleware
body: <p>Is there any way to pass complex parameter (for example array of objects) to middleware in laravel? I know that I can pass strings via some kind of DSL but I need to pass some more complicated data to one of middlewares. Is this achievable? And if so, how?</p>
  
  <p>There is example what I want to achieve</p>
  
  <pre><code>class Middleware
  {
      /**
       * Handle an incoming request.
       *
       * @param  \Illuminate\Http\Request  $request
       * @param  \Closure  $next
       * @return mixed
       */
      public function handle($request, Closure $next, array $modifiers = null)
      {
          foreach($modifiers as $name =&gt; $closure) {
              $request-&gt;$name = $closure($request-&gt;name)
          }
          return $next($request);
      }
  }
  </code></pre>
  
  <p>And I want to pass</p>
  
  <pre><code>[
      'param' =&gt; function($param) { return $param * 2; }
  ]
  </code></pre>
  
  <p>As <code>$modifiers</code> parameter to Middleware, and that array will be different for different routes so passing by global context is no go.</p>