Essays
Writing
Topics
20 of 43 essays
2026
· 0 min read
Scaling a Laravel MCP Tool Registry to 46 Tools
The May 12 post covered the MCP server architecture. This one goes inside the tool registry: class-per-tool structure, Sanctum ability scoping, JSON Schema validation before dispatch, tag-based auto-discovery, and the three things that broke when the registry hit 46 tools.
· 0 min read
Voyage AI vs OpenAI Embeddings for Technical RAG in PHP
Why I switched from OpenAI text-embedding-3-small to Voyage AI voyage-code-3 for this portfolio's RAG layer — model comparison, the input_type asymmetry Voyage requires, measured retrieval improvement, and the migration path that keeps search live throughout.
· 0 min read
A Claude Tool-Calling Loop in Laravel: From First Request to Final Answer
The exact pattern for registering tools, dispatching multi-turn Claude conversations, and processing tool results in a Laravel service — including the three production failure modes the happy path does not cover.
· 0 min read
MCP Servers for Laravel: A Production Pattern
How I built the MCP server that powers AI access to this portfolio — JSON-RPC over Streamable HTTP, Sanctum bearer auth, an ability-scoped tool registry, and the gotchas worth knowing before you ship.
· 9 min read
RAG on SQLite: Pure-PHP Cosine Similarity Without pgvector
How I built RAG retrieval against a SQLite database using pure-PHP cosine similarity — when it scales, when it doesn't, and the migration path to pgvector.
· 10 min read
A Multi-Provider AI Driver Pattern for Laravel
A clean driver pattern for switching between Claude, OpenAI, Groq, and Ollama in a Laravel app — with failover, testing, and a single calling interface.
· 8 min read
Cutting Claude API Costs by 89% with Prompt Caching
A practical Laravel integration of Anthropic prompt caching — what to cache, the 1024-token minimum, multi-breakpoint strategies, and real cost numbers.
2025
· 7 min read
Splitting Laravel into Three Vite Bundles for Smaller Pages
How I split this portfolio into three independent Vite bundles (frontend, auth, dashboard) — separate dependencies, separate CSS, working HMR across all three.
· 8 min read
Caddy + Laravel: A 50-Line Production Config
The exact Caddyfile I run in production — automatic HTTPS, HTTP/3, security headers, rate limiting, asset caching, all in ~50 lines.
· 8 min read
Supervisor for Laravel: Queue Workers, Scheduler, Horizon
Production Supervisor configs for Laravel queue workers, schedule:work, and Horizon — with the gotchas around stopwaitsecs, max-time, and zero-downtime restarts.
· 8 min read
Cloudflare in Front of Laravel: Real IPs, Trusted Proxies, Locked-Down Origins
How to make Laravel see real visitor IPs through Cloudflare — TrustProxies config, origin firewall rules, geolocation headers, and the caching gotchas.
· 8 min read
Building a RAG Pipeline in Laravel with pgvector
How I built the AI chat on this site: chunking documents, generating embeddings with Voyage AI, storing them in pgvector, and answering questions with Claude.
· 10 min read
Laravel Queues at Scale: Lessons from 10 Million Jobs
Patterns and pitfalls I've learned running Laravel queues in production — from connection pooling and job chunking to dead-letter handling and zero-downtime deployments.
· 8 min read
Hunting N+1 Queries in Laravel: Tools, Strict Mode, and Fixes
How to find N+1 queries with Telescope, Debugbar, and preventLazyLoading() — and the eager-loading patterns that fix them, including the polymorphic gotcha.
· 9 min read
10 Eloquent Query Optimizations, in Order of Effectiveness
A systematic optimization checklist for Eloquent — select(), chunk(), chunkById(), withCount(), pluck(), subquery selects, and when to bypass the model layer entirely.
2024
· 10 min read
Six Redis Patterns Every Laravel App Eventually Needs
Cache, sessions, queues, rate limiting, locks, pub/sub — the Redis patterns I use in production Laravel apps, with the trade-offs and the failure modes.
· 9 min read
Building a Dark Design System with Tailwind CSS v4
How I designed the D1 "Dark Precision" system for this site — CSS-first @theme config, custom tokens, and a palette that passes WCAG at every level.
· 8 min read
Feature Testing Laravel Applications with Pest
A pragmatic guide to writing fast, readable feature tests in Laravel using Pest — from test structure to database setup and API testing.
· 11 min read
Deploying Laravel on a VPS: Caddy, Supervisor, and Zero-Downtime Releases
The exact setup I use to deploy Laravel on a raw Ubuntu VPS — Caddy for automatic TLS, Supervisor for queue workers, and an atomic symlink deploy script.
· 9 min read
Semantic Search with pgvector and Laravel Scout
Add meaning-based search to your Laravel app using a custom Scout driver, pgvector HNSW index, and Voyage AI embeddings — with a hybrid keyword fallback.
About Laravel
Everything Al Amin Ahamed has written about Laravel — written after shipping rather than before, so what is in here is what the constraint turned out to be and what I got wrong first.