2FAuth/app/Http/Middleware/ForceJsonResponse.php
2022-11-25 15:20:36 +01:00

23 lines
400 B
PHP

<?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);
}
}