This tutorial walks through the improved ease with which you will be able to create and set UUIDs inside of your application to create genuinely unique identifiers for your database.
- [Instructor] UUID generation is a typical problem.…If we want either to have our IDs be un guessable…or if we have a distributed data store system…and need values that are not just standard integer based…incrementing IDs.…Laravel added some new code to make it easier to generate…these types of values.…Let's open up our community-poll application…in our text editor and we'll open up…the collision sample command…at app, Console, Commands, CollisionSample.php.…
Let scroll down to line 41 and we'll replace our log stack…method with echo, backslash, Illuminate, backslash,…Support, backslash, S-T-R, colon colon, uuid.…This string method uuid will echo a basic uuid value.…We can try it out by running our application…using the command php artisan test…in our terminal application.…
So open up your terminal application and run the command…php atisan collision colon test,…and you'll see we get out a standard uuid value.…We can run it a couple more times,…and verify each time we're getting out a unique string.…You'll notice here our strings don't conform to any…
Share this video
Embed this video
Video: UUID generation