headers->set('Accept', 'application/json'); // set json response return $next($request); } }