Unique URL Creation - PHP / Laravel


I am wanting to have users submit an image and some information to my web application and I want the web application to produce a unique URL where that data can be viewed at a later time. The user can share the URL and others can then simply view the images and information that was uploaded / provided by the original user if that makes sense. Something like jsFiddle or Screencast (attached image for context). You can see the unique URL that is generated server side. I am using PHP / Laravel if that helps.

Thanks in advance,

SteveImage of screencast showing unique URL produced
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Ray PaseurCommented:
A unique URL would be available by using this PHP function (and there are others like md5() that can help).

Have you started this project?  Is there any design / code you can share with us?

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
SteveP495Author Commented:
Thanks vm for this. Yes, I have started the project but am just front-running future requirenents..
This may be a dumb question but as I will be usinb the same single server, is there any need to use the unique id you have mentioned ?

I mean the url could just be /1 then /2 etc ? Are we saying that there is a risk that two requests could be processed at the exact same tkme ? If that is the case, I am confused as I thought synchronisation was nandled by the MYSQL  database driver ?

Thanks in advance,
Ray PaseurCommented:
If you use an AUTO_INCREMENT key, MySQL will generate a dependably unique integer.  I believe that Laravel's ORM expects tables to have a column named "id" set up as an AUTO_INCREMENT key, so that might work well.  It would be predictable.  That means that if I found a request to return image number 123, I could reasonably assume a similar request could return image 122, or any image that is numbered in a similar pattern.  That might produce a security exposure.  Just a thought.
SteveP495Author Commented:
Thanks for the pointer and consideration.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.