Level 122
I always use web routes for ajax requests.
Save API routes for communicating with third parties who shouldnt / cant use sessions
1 like
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hello,
I have a user signup form and I'm validating it using ajax. Username must be unique so I use ajax to check for it.
Ajax needs an URL where to send the post request. This URL is for internal use only. No external application / domains / sites will use it.
I was wondering what's the best approach between using a normal route or an api route according to Laravel best practices.
Thanks, Simon
Please or to participate in this conversation.