1 year ago

Best way to handle complex form with Laravel vs Vue

Posted 1 year ago by hepabolu

I'm building a form that needs to add a book to the database. The intention is to:

  • make entering the data as easy as possible
  • prevent the creation of a duplicate book
  • prevent the creation of duplicates of the author's name

The idea is to do the following:

  • when the user enters an ISBN, the ISBN is checked against the database for duplicates. If it's a duplicate the book information is mentioned and the book form cannot be submitted.
  • if the ISBN doesn't exist, the website goes out and fetches the information from Google books or Amazon and prepopulates the fields so user only needs to check the information and either correct or add additional data.
  • if the author name is entered, it is checked against available names in the database using some fuzzy matching to allow for typos. If the name doesn't exists, we move on to the next field.
  • if the author exists, a list of possible candidates is shown so the user can pick the right one.

What's the best approach to handle all this interaction? Laravel Blade + Form Requests? Vue? Controllers? Any combination and so which component has which task?

Please sign in or create an account to participate in this conversation.