title: Setting response headers with middleware in Lumen
body: <p>I'm trying to set a header (<code>X-Powered-By</code>) using an <code>AfterMiddleware</code> in the Lumen micro-framework. Unfortunately, the header isn't being set. It is assumed that the middleware (shown below) isn't even being handled.</p>
  
  
  
  <p><strong>AfterMiddleware.php</strong></p>
  
  <pre class="lang-php prettyprint-override"><code>&lt;?php namespace App\Http\Middleware;
  
  use Closure;
  
  class AfterMiddleware {
  
      public function handle($request, Closure $next)
      {
          $response = $next($request);
  
          $response-&gt;header('X-Powered-By', env('APP_NAME') . '/' . env('APP_VER'));
  
          return $response;
      }
  }
  </code></pre>
  
  <p><strong>bootstrap/app.php</strong> middleware setter</p>
  
  <pre class="lang-php prettyprint-override"><code>$app-&gt;middleware([
      'App\Http\Middleware\AfterMiddleware'
  ]);
  </code></pre>
  
  <p>Am I missing something here?</p>