Glossary

Browse the full collection of lesser-known Laravel features.

Hidden Methods Beginner

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.

Collections Helpers
Since Laravel 5.3
Hidden Methods Beginner

Str::squish()

Collapse all consecutive whitespace (including newlines and tabs) into a single space and trim the result.

Helpers
Since Laravel 9.x
Eloquent Secrets Intermediate

Model::withoutTimestamps()

Execute operations without touching the updated_at column, useful for bulk imports and data migrations.

Database
Since Laravel 10.x
Blade Tricks Beginner

The @once Blade Directive

Render a block of template content only once per rendering cycle, even inside a loop.

Helpers
Since Laravel 8.x
Unknown Classes Intermediate

The Sleep Class

A testable, expressive wrapper around PHP's sleep functions with a fluent API.

Testing Helpers
Since Laravel 10.x
Artisan & CLI Beginner

artisan about

Get a comprehensive overview of your application environment, drivers, and configuration in a single command.

Debugging Configuration
Since Laravel 9.x
Unknown Classes Intermediate

The Lottery Class

Execute a callback with a given probability — perfect for sampling, feature flags, and A/B testing without external services.

Testing Helpers
Since Laravel 10.x
Hidden Methods Intermediate

Number::pairs()

Split a numeric range into evenly sized chunks as start/end pairs — great for batch processing and pagination math.

Performance Helpers
Since Laravel 10.x
Hidden Methods Beginner

The once() Helper

Memoize the result of an expensive expression so it only executes once per request, no matter how many times it is called.

Performance Helpers
Since Laravel 11.x
Hidden Methods Beginner

Arr::undot()

Expand a flat dot-notation array back into a fully nested structure — the inverse of Arr::dot().

Collections Helpers
Since Laravel 9.x
Eloquent Secrets Advanced

DB::whenQueryingForLongerThan()

Get notified when your cumulative database query time exceeds a threshold during a single request.

Database Performance Debugging
Since Laravel 10.x
Unknown Classes Beginner

Benchmark::dd()

Time one or more closures and dump the results — the quickest way to compare performance of different approaches.

Performance Debugging
Since Laravel 10.x