Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

_chris's avatar

API real-time validation

I'm building an API which will include route for users to register for accounts. I'm also building a vue spa which will have a form for people to register. Ideally I'd like to do real-time validation for the username field and am wondering what the best way to do that is. I'm thinking the only way is to create a route specifically to validate the request but not actually create the account, something like:

/api/register/validate - validate only
/api/register - perform the registration

Or maybe there is a reason not to do it? I've not seen any examples of it which is why I ask.

0 likes
1 reply

Please or to participate in this conversation.