'Laravel 9 Vuejs 3 Want To Prettify The URL After Axios GET Call?

I am building a search form. Users can search for domain suggestions by typing a keyword into the search input. The input is a simple text field. Currently, my search URL is http://localhost:8000/search. When a user searches, I make an axios call to the backend to retrieve search results.

All of this works fine but I want to prettify the url when a user searches? For example, if the user searches the keyword "property", then I want the url bar to show http://localhost:8000/search?q=property after the axios call? How would I go about doing that?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source