Laravel performance, architecture & reliability

28 guides covering the problems I actually get called for in Laravel backends: slow pages and databases, queues and integrations that must not fail, architecture that survives growth, security, legacy upgrades, and AI features built for production. Every guide has real code, not filler.

Common problems this covers

  • A page or endpoint that used to be fine now takes seconds under real traffic.
  • Queue jobs that fail silently, run twice, or fall behind during peak load.
  • A framework or PHP version several majors behind, with no tests to change it safely.
  • A first AI or LLM feature that needs to behave like production code, not a demo.
  • Nobody is quite sure whether the current architecture will survive the next year of growth.

Not sure where to start?

If something is slow and you do not yet know why, start with profiling. It points at whichever of the other guides actually applies.

How to Profile a Laravel Application

Laravel guides

Performance

Where the time actually goes, and the fixes that follow from measuring it.

Laravel guides

Queues, webhooks & integrations

Jobs and API calls that must not silently fail, duplicate or get lost.

Laravel guides

Architecture & security

Structure that survives growth, and the checks I run before something ships.

Laravel guides

Consistency across services

Keeping data and events correct once one operation spans several systems.

Laravel guides

Upgrades & legacy code

Moving a Laravel app forward without a rewrite or a feature freeze.

Laravel guides

AI & automation

LLM features and agent tooling built to survive production, not just a demo.

OpenAI & Anthropic APIs in Laravel

Put LLM features into a Laravel app reliably: queued calls, timeouts and retries, rate limits, structured output validation, cost caps, prompt injection and evaluation. With code.

Read the guide

LangChain, LlamaIndex or a Direct API Call?

A backend engineer's trade-off guide to LLM framework complexity: when LangChain or LlamaIndex earn their place, when a direct OpenAI/Anthropic API call and pgvector are simply less to maintain, and how to decide for your own feature.

Read the guide

Build an MCP Server in PHP

Build a Model Context Protocol (MCP) server in PHP with the official mcp/sdk package, expose a real API (Google Search Console) as a tool, then deploy it to Cloud Run over streamable HTTP.

Read the guide

Using AI Coding Agents on a Legacy PHP Codebase

AI coding agents are genuinely useful on legacy PHP — and genuinely dangerous on code with no tests. What actually works: characterization tests first, small reviewable steps, and treating the agent like a fast engineer who needs the same guardrails as anyone new to the codebase.

Read the guide

PHPStan for AI-Generated PHP and Laravel Code

AI coding agents write PHP that looks right and calls methods that don't exist. How to use PHPStan and Larastan as the first check on AI-generated code: which level, a baseline for old code, a hook that feeds errors back to the agent, and a CI gate it can't quietly bypass.

Read the guide

Sloppy: Static Analysis for AI-Written PHP Debt

PHPStan tells you AI-written PHP is wrong. Sloppy tells you it will be expensive: swallowed exceptions, N+1 queries, placeholder methods, weakened tests. How to roll it out on an existing Laravel codebase without drowning in findings, and where it fits next to PHPStan, hooks and CI.

Read the guide
See the AI & Automation guide hub

Whichever database you run

Database-specific guides

Laravel's query builder and Eloquent sit on top of a real database. These go deeper on PostgreSQL and MySQL themselves.

See the PostgreSQL guide hub

Need this done, not just explained

If you would rather I just fix it