Controlling randomness in Laravel (watch me code)

Published: 17 June 2024
on channel: Aaron Francis
5,456
268

Laravel's Str::random and Lottery helpers produce random results, which is usually what we're looking for! But sometimes we want repeatable randomness. In this video we take a look at how to control the randomness.

Follow Aaron:
Twitter:   / aarondfrancis  
LinkedIn:   / aarondfrancis  
Website: https://aaronfrancis.com - find articles, podcasts, courses, and more.

Featured in this episode:
https://laravel.com/docs/11.x/strings...
https://laravel.com/docs/11.x/helpers...

Chapters:
00:00 - Introduction to Benchmarking and Random Value Generation
01:36 - Introduction to Mersenne Twister and Seeding Randomness
02:58 - Example of Repeatable Random Values with Mersenne Twister
03:54 - Wrapping Randomness Control in Laravel
04:52 - Creating Predictable Random Strings
06:00 - Generating Repeatable Random Strings
08:01 - Controlling Lottery Results with Predictable Randomness
09:58 - Modifying Lottery Class for Seeding Randomness
10:54 - Testing and Verifying Lottery Randomness
12:07 - Improving and Resetting Randomness for Benchmarking
13:47 - Refactoring for Global Seeding and Control
15:11 - Debugging and Stabilizing Randomness for Multiple Calls
17:18 - Finalizing Predictable Randomness for Benchmarks
19:09 - Considering Edge Cases and Final Thoughts
20:17 - Conclusion and Feedback Request


Watch video Controlling randomness in Laravel (watch me code) online without registration, duration hours minute second in high quality. This video was added by user Aaron Francis 17 June 2024, don't forget to share it with your friends and acquaintances, it has been viewed on our site 5,456 once and liked it 268 people.