How does someone reach the page? Can you give more context?
Friendly URL's by displaying name apose to ID...
Hi all, I know this has been covered in similar questions but i can’t find anything that is exactly how i need it to be which leaves me wondering if its possible or not. My knowledge of laravel is rather limited and I’m by no means an expert in php or any other language! One would suggest a beginner status is appropriate in my skill set!
What I am actually trying to do is retrieve a record from my database without having to send the ID in the url or anyother numeric identifier, I was hoping to be able to have the url structure something as follows:
www.example.com/profiles/John-Doe
I know I could do a simple query to get either the username or full name but there is two reasons Im hoping there could be a workaround, The first reason is the user signs up with Email and Password followed by First name and Last name input fields and the second reason is that there could be another user name John Doe.
Right now my urls look like this: www.example.com/profiles/12101/John-Doe with the number being the unique identifier.
Would it be possible to switch this out and refer to the profile by name but still lookup the database using the id field? Surely some of the biggest websites out there that hide numeric fields and replace them with named fields are using some sort of switch method or something that can achieve a similar approach?
In theory im basically trying to mask the url or trick the url as I don’t want someone to be able to just swop out the name like so: www.exampe.com/profiles/John-Doe for www.example.com/profiles/Mary-Jane and be able to access the next profile so using a unique identifier like the first example I show is something I would prefer to have as the database query but just mask the url with the name if this is possible in anyway?
Much appreciated for any help or input given. Thanks for your time.
Please or to participate in this conversation.