Yes, it's a good approach, here is the article which covers it, if you're struggling with the actual implementation: https://itnext.io/vuejs-and-laravel-realtime-unique-input-validation-a6d9220be1c5
Feb 8, 2022
1
Level 2
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.
Please or to participate in this conversation.