English for Laravel Developers
Master the English vocabulary Laravel developers use for Eloquent, service containers, and queues when discussing PHP application code with a team.
Laravel’s “convention over configuration” philosophy comes with a rich, opinionated vocabulary — Eloquent relationships, service container bindings, and facades all have precise English names that a team needs to share to review code efficiently, rather than describing them in vague, roundabout terms. This guide covers the English used when discussing Laravel code with a team.
Key Vocabulary
Eager loading — loading related Eloquent models up front with the parent query, using with(), to avoid firing a separate query for each related record.
“This view is triggering an N+1 query — let’s eager load the comments relationship with with('comments') instead of lazy loading it in the loop.”
Service container — Laravel’s dependency injection container, responsible for resolving classes and their dependencies automatically, and where bindings are registered. “Bind the interface to the concrete implementation in the service provider so the container can resolve it automatically wherever it’s type-hinted.”
Facade — a static-looking interface (like Cache::get()) that proxies to an underlying class resolved from the service container, giving a simple syntax without sacrificing testability.
“Even though Cache::get() looks static, it’s a facade — under the hood it resolves the real cache instance from the container, so it’s still mockable in tests.”
Migration — a version-controlled PHP file describing a schema change, run in order to keep the database structure in sync across environments. “Don’t edit an already-run migration — write a new one to alter the column, so environments that already applied the old migration stay in sync.”
Job / queue — a class representing a unit of deferred work, dispatched onto a queue and processed asynchronously by a worker, used for slow or non-critical tasks. “Move the invoice PDF generation into a queued job — right now it’s running synchronously in the request and adding three seconds to checkout.”
Middleware — a class that intercepts HTTP requests before they reach a route’s controller, used for cross-cutting concerns like authentication or rate limiting. “We should add this check as middleware rather than repeating it at the top of every controller method — it’s a cross-cutting concern, not route-specific logic.”
Common Phrases
- “Is this triggering an N+1 query — should we eager load that relationship?”
- “Where’s this binding registered — which service provider?”
- “Can we move this to a queued job instead of running it synchronously in the request?”
- “Is this a new migration, or are we editing one that’s already run in production?”
- “Should this check be middleware instead of duplicated logic in the controller?”
Example Sentences
Reviewing a pull request:
“This controller is looping over orders and calling $order->customer inside the loop — that’s an N+1 query, let’s eager load customer in the initial query instead.”
Explaining a design decision: “We bound the payment gateway interface to a concrete Stripe implementation in the service provider, so swapping providers later is a one-line change, not a codebase-wide refactor.”
Describing a bug: “The migration worked locally because the column already existed from an earlier manual change, but it failed in staging because that state didn’t match.”
Professional Tips
- Say “N+1 query” precisely when describing the eager loading problem — it’s the standard term reviewers look for, more specific than “too many queries.”
- When reviewing a facade-heavy class, ask “is this still testable?” — facades are mockable, but overuse can still make intent unclear in review.
- Distinguish “queued” from “synchronous” when describing where a job runs — this affects both user-perceived latency and failure handling.
- Use “service provider” specifically when explaining where a binding is registered — saying “somewhere in the container” is too vague for code review.
Practice Exercise
- Explain in two sentences what an N+1 query problem is and how eager loading fixes it.
- Write a one-sentence code review comment recommending a job be queued instead of run synchronously.
- Describe, in your own words, the relationship between a facade and the service container.