Laravel Form for searching records

0

I come from desktop programming and I'm starting studies on Laravel with Bootstrap. I would like to know if it is possible to create a form (preferably modal) for searching records. For example, when registering a person, instead of using a select component to select the city, create a form where to search and return the code of the selected city. Is it possible to do that?

    
asked by anonymous 16.10.2017 / 03:30

1 answer

0

Yes it is possible, but you will need lots of javascritp programming and create an API in laravel for AJAX responses. You would have to create the modal with an input box by triggering the keydown event and each key pressed would call the API that would return the clients. For example, you type "C" and the API returns clients starting with "C", the user continues typing "a" then the API returns clients that start with "Ca" and so on. Another output would be for the user to enter the entire name of the client that it searches for and press a button to call the API and return the clients that match that search pattern. For this you could use JQuery, Angular or VueJs. Laravel comes pre-configured to use VueJs you can read more on the Fronted Scaffolding and Compiling Assets in the official documentation.

    
16.10.2017 / 15:56