phpvms/app/Http/Middleware/JsonResponse.php
2018-03-19 20:50:40 -05:00

20 lines
322 B
PHP

<?php
/**
* Set the content type in the API layer
*/
namespace App\Http\Middleware;
use Closure;
class JsonResponse
{
public function handle($request, Closure $next)
{
$response = $next($request);
$response->headers->set('Content-Type', 'application/json');
return $response;
}
}