vendredi 23 octobre 2015

How can I create a unique random string in laravel 5

I am new to laravel 5. I am working on a project where I want to assign some random-readable unique string to each application. I have knowledge of the each application id which may be use as a seed. Since the app is going to be use within the company I don't worry much about security. I expect the table size to grow so my goal is to achieve uniqueness as much as possible because the field in DB is unique. A code like (EN1A20, EN12ZOV etc). If the function can allow me to pass the length of the string I want returned, that would be really awesome.

Appreciate help.




Aucun commentaire:

Enregistrer un commentaire