The Sleep Class
A testable, expressive wrapper around PHP's sleep functions with a fluent API.
Powerful classes that exist in Laravel but rarely appear in tutorials.
A testable, expressive wrapper around PHP's sleep functions with a fluent API.
Execute a callback with a given probability — perfect for sampling, feature flags, and A/B testing without external services.
Time one or more closures and dump the results — the quickest way to compare performance of different approaches.
Serve stale cache immediately while refreshing in the background — the stale-while-revalidate pattern built into Laravel.