Level 63
If you need to customize the returned message, you can do that.
Otherwise I think it's not necessary because Laravel returns automatically the correct code. That's what I notice with my API methods.
1 like
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hello
If I have an ajax call to some method in my controller, which updates the DB, what is a proper way to return the status to the frontend?
do you return response(...) with the correct code? Or something else?
thanks
Please or to participate in this conversation.