Guides
Problems I am usually called for in PHP and Laravel backends, and how I approach them.
What's going on?
Pick the closest match, skip straight to the guide.
33 guides
Slow app or database
Pages, endpoints or queries got slow, and you need to find out where the time goes.

How to Profile a Laravel Application
Find out where a Laravel application is actually slow before you fix anything: Debugbar and Telescope locally, Xdebug and Blackfire for CPU time, pg_stat_statements and slow logs in production, Horizon for queues.
Laravel

Laravel Performance Audit
A practical Laravel performance triage you can run in 30 minutes, what a full audit adds, and what you get: report, query plans, merged fixes. Fixed price, 5 days.
Laravel

Slow Laravel Queries: Find and Fix Them
Find slow queries in a Laravel app with DB::listen and per-request budgets, then fix the Eloquent patterns behind them: get()->count(), PHP aggregates, deep pagination and more. With code.
Laravel

Laravel N+1 Queries: Detect and Fix
What N+1 queries are in Laravel and how to find and fix them: preventLazyLoading, eager loading, withCount, API resources, policies and a test that fails when they come back.
Laravel

PostgreSQL Slow Query? Fix It with EXPLAIN ANALYZE
Why a PostgreSQL query takes too long and how to fix it: find slow queries with pg_stat_statements, read EXPLAIN ANALYZE line by line, then add the right index, statistics or rewrite. Copy-paste SQL.
PostgreSQL

PostgreSQL Indexing for Laravel Apps
Which PostgreSQL indexes a Laravel app needs: missing foreign key indexes, composite column order, partial, expression, trigram and JSONB indexes, plus finding unused ones. With SQL.
LaravelPostgreSQL

MySQL Slow Query Optimization for PHP Apps
Find and fix slow MySQL queries in a PHP or Laravel app: slow query log, EXPLAIN, composite indexes, implicit conversions, collations and pagination. Copy-paste SQL included.
MySQL

Laravel Redis Caching Strategy
Use Redis caching in Laravel without stale data or stampedes: key design, tag invalidation, atomic locks, separating cache from queues and measuring hit rate. With code.
Laravel
Queues, webhooks, integrations
Jobs fail, run twice or vanish; webhooks and partner APIs break your flows.

Laravel Queue Jobs Failing or Dropping
Why Laravel queue jobs run twice, vanish or pile up: retry_after vs timeout, dispatching before commit, missing models, Redis eviction and stale workers. With config and code.
Laravel

Laravel Queue Performance: Horizon, Workers and Scaling
Make Laravel queues keep up under real load: split queues by speed, size worker pools correctly, choose Horizon's balance strategy, and monitor wait time instead of guessing.
Laravel

Idempotent Laravel Jobs and Safe Retries
Design Laravel jobs that are safe to retry: idempotency keys, unique constraints, atomic locks, external API idempotency and a test that runs the job twice. With code.
Laravel

Reliable Stripe Webhooks in Laravel
Handle Stripe webhooks in Laravel reliably: signature check on the raw body, dedupe by event id, respond fast, process in a queue and reconcile. With controller, migration and job code.
Laravel

Reliable API Integrations in Laravel
Build third-party API integrations in Laravel that degrade gracefully: timeouts, retries, rate limits, a mapping layer, webhooks with reconciliation and tests with Http::fake. With code.
Laravel
Old PHP and upgrades
An old PHP or Laravel version, no tests, and a system that cannot stop.

Upgrading Legacy PHP to PHP 8
Move a legacy PHP 5.x or 7.x application to PHP 8: compatibility scan, removed functions, deprecations, intermediate versions, Rector and a safe rollout. With commands.
PHP

Upgrading an Old Laravel Version Safely
How to upgrade an old Laravel app several major versions without a freeze: safety-net tests, Rector, Larastan, one major at a time, package blockers and a CI matrix. With commands.
Laravel

Refactoring Legacy PHP Without Tests
Refactor a legacy PHP codebase that has no tests: run it in Docker, pin behaviour with characterization and golden-master tests, extract seams and change it in small safe steps.
PHP
Architecture and API design
Structure that survives growth, consistent APIs and auth, and data that stays consistent across services.

Laravel Application Architecture That Scales
Structure a growing Laravel application: thin controllers, action classes, Form Requests and Resources, events after commit, when a repository helps and how to restructure gradually.
Laravel

Laravel Microservices or a Modular Monolith?
When Laravel microservices make sense and when a modular monolith with queues is the better call: real reasons to split, what each option costs, enforced module boundaries and how to extract a service.
Laravel

Laravel REST API Best Practices
Laravel REST API practices that hold up in production: resources, form requests, consistent errors, cursor pagination, versioning, rate limiting and idempotent POSTs. With code.
Laravel

Laravel Sanctum vs Passport: Which to Use
Sanctum or Passport? A decision tree, a comparison table and working setup for SPA cookies and API tokens with abilities and expiry. Default to Sanctum unless you need OAuth2.
Laravel

The Transactional Outbox Pattern in Laravel
Saving a row and publishing an event about it are two writes that can't share a transaction. The transactional outbox pattern in Laravel fixes lost and ghost events: an outbox table, a relay worker with SKIP LOCKED, and idempotent consumers.
Laravel

Saga Pattern in Laravel: Transactions Across Services
When one business operation spans several services or external APIs, there is no transaction to roll back. The saga pattern in Laravel: local steps with compensating actions, orchestration vs choreography, persisted saga state and the mistakes that leave orders half-done.
Laravel

CQRS and Event Sourcing in Laravel: When They Pay Off
CQRS separates the model that changes data (commands) from the model that reads it (queries). Event sourcing stores every change as an event. What each pattern really costs in a Laravel app, how they fit together, and when plain CRUD is the better choice.
Laravel
Security
What to check before going live, and what to do after a breach.

Laravel Security Checklist for Production
A practical Laravel security checklist: authorization and IDOR, mass assignment, raw SQL, XSS, uploads, secrets, dependencies, rate limiting and safe production settings. With code.
Laravel

PHP2Shell: Patch PHP, Check for Compromise, Protect Your SEO
PHP2Shell (CVE-2026-109618 and CVE-2026-109619) lets an unauthenticated request run code on PHP servers. What to patch first, what to do if you can't, how to tell whether you were hit, and how to clean up search results if attackers used your site for spam.
PHP
AI features and automation
LLM features, semantic search, MCP servers and n8n workflows that hold up in production.

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.
Laravel

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.

Semantic Search in Laravel with PostgreSQL (pgvector)
Add semantic search to a Laravel app using PostgreSQL's pgvector extension: generating embeddings, choosing a distance function and index type, combining vector and full-text search, and the Eloquent patterns that actually work for a vector column.
LaravelPostgreSQL

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.
PHP

Making n8n Workflows Production-Reliable
n8n automations fail in production the same way any integration fails: rate limits, timeouts, duplicate triggers. A backend engineer's guide to idempotency, retries and monitoring for n8n workflows that run unattended for years, not demos.
n8n
AI-written code
Using coding agents on real codebases and catching what they get wrong.

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.
PHP

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.
PHP

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.
PHP