why do you want to generate an id? if it's to mask id's in an url you can use something like http://www.hashids.org/php/
it's better to use basic numeric id when using Laravel if you don't want to change a lot. (Relationships for example)
if you still need to generate your own id I suggest you use uuid v4, the collision (change that it generates the same id twice) is very low
zenry said:
why do you want to generate an id? if it's to mask id's in an url you can use something like http://www.hashids.org/php/
it's better to use basic numeric id when using Laravel if you don't want to change a lot. (Relationships for example)
if you still need to generate your own id I suggest you use uuid v4, the collision (change that it generates the same id twice) is very low
Thanks for comment, but UUID is too long for my system
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community