Home > Article > Backend Development > Please tell me about laravel returning status_code value
Because some operators, routers, browsers, etc.;
will intercept non-200 status requests; and then change them to their advertisements or customized pages;
Then the question comes; please tell me,
Where can laravel control all returned status_code values?
The effect I want to achieve is that all ajax requests return 200;
Thank you;
--------------------------Separating line--------------------------
Because there are too many issues involved such as dingo, jwt, etc.;
Temporarily give up the practice of unifying status_code;
When there is a good plan, we will fill in this hole again;
Because some operators, routers, browsers, etc.;
will intercept non-200 status requests; and then change them to their advertisements or customized pages;
Then the question comes; please tell me,
Where can laravel control all returned status_code values?
The effect I want to achieve is that all ajax requests return 200;
Thank you;
--------------------------Separating line--------------------------
Because there are too many issues involved such as dingo, jwt, etc.;
Temporarily give up the practice of unifying status_code;
When there is a good plan, we will fill in this hole again;
Error throwing is controlled by the Symfony/Component/Debug/Exception/FlattenException
class in the framework. The file is in
/vendor/symfony/debug/ExceptionFlattenException.php
Modify the create method, there may be other situations where you can try modifying it yourself
<code> if (null === $statusCode) { $statusCode = 200; } </code>