S
S
SM_ST2021-06-11 23:40:18
Laravel
SM_ST, 2021-06-11 23:40:18

How to do city select with city name in Laravel url?

Hello!

Tell me how to implement the name of the city in the url?

There is a modal with a list of cities, each city has a slug. How, after clicking on a city, to make the slug of the city always be after the domain name, until another one is selected?

The list of cities is stored in the database

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
pLavrenov, 2021-06-14
@pLavrenov

if I understand correctly, then the question is not related to the Laravel branch
https://developer.mozilla.org/ru/docs/Web/API/Loca...

function changeURL() {
        var theURL = window.location.pathname;
       return  theURL.replace("/url_part_to_change/", "/new_url_part/");
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question