Sure, you can do that. Typically developers are using database IDs to reference an object from the database in the URL like you did before. This is usually a very nice way to do it because you can simply use the ID from the URL to load the corresponding object from the database.
If you want to have names in the URL this will become a little bit harder. If your model object has something like a name you could use that instead. But you have to make sure that names are unique so that you can always find the correct model object in the database when only having the name and not the ID any more.
If cannot make sure that the name is unique, you should add something like a “URL key” property to your object which is guaranteed to be unique (containing “toyota” for example).
Another option would be to use both the ID and the name of the entity in the URL. Something like:
That would allow you to use the ID to load the correct object from the database and you have a pretty name of the entity in the URL. You would use the ID to load the object from the database and just ignore the name
That’ something Amazon does in a similar way. Look at this URL: