It depends what you mean by "hide" and why you'd want to
You can substitute it for something else (basically a slug), but that's more obfuscating than hiding
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I know there are a lot of threads had been asking how to hide the ID from URL as the user might try to abuse it by input different ID.
After reading few threads from Stackoverflow, Laracast or other sources, I still don't find any solution yet and most of the replied from the forum was "No, it is impossible to hide it".
Some of the sources were using encryption method to hide the ID.
There is one solution comes into my mind which is using the UUID but I am uncertain if this is a workaround.
Example like http://www.example/item/b14e5c00-e899–11e5–9c37-df062687b
I need some advice.
Hashids!
https://github.com/ivanakimov/hashids.php
It's basically what Youtube etc do - i've got two or three projects where i've got HashIDs set up to obfuscate URLs in my application.
Essentially, i use eloquent's events to listen for a new model being created, then take the ID of it, convert that into a hashids string with a minimum length of say...6.
Then, you can use these in your URLs to lookup models as they'll be unique (because they're based off of the ID, which is unique).
And you can also override the Route Model Bindings to use the hashid to look for your model instead of the numeric ID so you can still use the route model binding goodness.
I'm tempted to do a quick screencast about this on my blog, i'll post back here if i get time to do it.
Please or to participate in this conversation.