The tap() Helper
Call a closure on a value and return the value, not the closure result. Perfect for chaining side-effects without breaking a fluent chain.
Browse the full collection of lesser-known Laravel features.
Call a closure on a value and return the value, not the closure result. Perfect for chaining side-effects without breaking a fluent chain.
Collapse all consecutive whitespace (including newlines and tabs) into a single space and trim the result.
Execute operations without touching the updated_at column, useful for bulk imports and data migrations.
Render a block of template content only once per rendering cycle, even inside a loop.
A testable, expressive wrapper around PHP's sleep functions with a fluent API.
Get a comprehensive overview of your application environment, drivers, and configuration in a single command.
Execute a callback with a given probability — perfect for sampling, feature flags, and A/B testing without external services.
Split a numeric range into evenly sized chunks as start/end pairs — great for batch processing and pagination math.
Memoize the result of an expensive expression so it only executes once per request, no matter how many times it is called.
Expand a flat dot-notation array back into a fully nested structure — the inverse of Arr::dot().
Get notified when your cumulative database query time exceeds a threshold during a single request.
Time one or more closures and dump the results — the quickest way to compare performance of different approaches.