How to Generate Random Unique String in Laravel?

By Hardik Savani | June 29, 2016 | Category : Laravel

Laravel provide several string helper that way we can use it easily like str_limit, str_plural, str_finish, str_singular etc. If you need to generate unique random string then you can use str_random() helper of Laravel. It is very simple and you can use easily.

str_random() helper take one numeric argument and return number of unique string that you pass as argument. you can see it's syntax and example:




$random = str_random(30);

Hardik Savani
My name is Hardik Savani. I'm a full-stack developer, entrepreneur and owner of Aatman Infotech. I live in India and I love to write tutorials and tips that can help to other artisan. I am a big fan of PHP, Javascript, JQuery, Laravel, Codeigniter, VueJS, AngularJS and Bootstrap from the early stage.
Follow Me: Github Twitter
***Do you want me hire for your Project Work? Then Contact US.