Stop wrapping query builder calls in if statements. The when() and unless() methods let you apply constraints conditionally while keeping the chain fluent.
Conditional Query Building with when() and unless()
Latest News
More Articles
Laravel's June 2026 updates added Bus::bulk(), which queues large batches of jobs with a single database insert per connection instead of one write per job.
Building a CSV export that holds an entire table in memory works until the table grows. Here is how to stream a download row by row so memory stays flat.
Eloquent will happily hide an N+1 query until it hits production. Strict model mode turns those silent mistakes into loud exceptions during development.
A handful of Artisan optimization commands shave real milliseconds off every request in production. Here is what each one does and when to run it.
Receive third-party webhooks safely in Laravel: verify signatures, skip CSRF correctly, guarantee idempotency, and process the payload on a queue.
Laravel's first-party AI SDK gives you one framework-native API for text, embeddings, tool-calling agents, and more across multiple providers.
Factory states, relationships, and sequences let you express exactly the test data a scenario needs in a single readable line.
Import a huge CSV without timing out by streaming it with LazyCollection and processing chunks through a Laravel job batch with progress tracking.