I'm trying to set a header (X-Powered-By
) using an AfterMiddleware
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.
AfterMiddleware.php
<?php namespace App\Http\Middleware;
use Closure;
class AfterMiddleware {
public function handle($request, Closure $next)
{
$response = $next($request);
$response->header('X-Powered-By', env('APP_NAME') . '/' . env('APP_VER'));
return $response;
}
}
bootstrap/app.php middleware setter
$app->middleware([
'App\Http\Middleware\AfterMiddleware'
]);
Am I missing something here?