2FAuth/app/Http/Middleware/ForceJsonResponse.php

22 lines
407 B
PHP
Raw Normal View History

2021-09-06 18:07:14 +02:00
<?php
namespace App\Http\Middleware;
use Closure;
class ForceJsonResponse
{
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return mixed
*/
public function handle($request, Closure $next)
{
$request->headers->set('Accept', 'application/json');
return $next($request);
}
}