Tips in Laravel

Explore all tips and tutorials about Laravel.
shape
shape
shape
shape
shape
shape
shape
shape

Laravel Hard

Transactional Outbox in Laravel: Never Lose an Event Between Your Database and the Broker

Writing to the database and a broker in one request loses or invents events on crashes. Fix the dual-write problem with an outbox table, relay and idempotent consumers.

Laravel 13 PHP 8.4 Mysql 8.4
Diagram Try the challenge
9 min Read tip
Laravel Medium

Laravel Pipelines: Turn a 340-Line Checkout Controller into Small, Testable Steps

Use the Laravel Pipeline facade to split checkout flows and query filters into pipe classes you can reorder, reuse and unit test, with the pitfalls to avoid.

Laravel 13 PHP 8.4
Diagram Try the challenge
9 min Read tip
Laravel Medium

Laravel Job Batching vs Chains: Progress, Failures, allowFailures and then/catch/finally

Bus::chain runs jobs in order and stops at the first failure; Bus::batch runs them in parallel with progress and callbacks. Learn exactly when then, catch and finally fire.

Laravel 13 PHP 8.4
Diagram Try the challenge
10 min Read tip
Laravel Medium

Idempotency Keys: Preventing Duplicate Payments in Distributed Systems

Why idempotency keys matter in payment APIs, how to implement them safely with a database-backed store, and common pitfalls like race conditions and key collisions.

PHP 8.4
Diagram
4 min Read tip
Laravel Medium

Laravel Query Optimization with Eager Loading

Learn how to optimize database queries in Laravel by using eager loading to prevent N+1 query problems.

Laravel 11.x PHP 8.2+
Diagram
2 min Read tip