Laravel Excellence Prover MCP Connector for Claude
A+AI agents generate Laravel code with N+1 queries, fat controllers, workarounds, and mass assignment holes. This tool forces excellence: optimize queries, use the framework idiomatically, separate responsibilities, guard mass assignment, and respect architecture. Zero tolerance for workarounds.
AI agents producing Laravel code consistently fail at framework mastery. They write code that works but violates every principle a senior Laravel developer upholds. The result: N+1 performance disasters, workarounds that bypass the framework's built-in solutions, controllers bloated with business logic, mass assignment vulnerabilities waiting to be exploited, and architectural patterns that crumble under scale.
The Problem It Solves
AI-generated Laravel code fails on five axes:
- N+1 queries — Accessing
$user->postsinside a@foreachloop withoutwith('posts'). Each iteration fires a separate SQL query. On 100 users, that's 101 queries instead of 2. The agent never callsModel::preventLazyLoading()and never audits Blade views for implicit relationship access. - Workarounds — Manual validation arrays instead of FormRequests.
Model::find($id)with null checks instead of Route model binding. Inline authorization instead of Policies. Manual JSON responses instead of API Resources. The agent reinvents what Laravel already provides — badly. - Fat controllers — Controllers with 50+ lines containing business logic, validation, database transactions, email sending, and cache management. The Single Responsibility Principle treated as a suggestion. Business logic should live in Service or Action classes, never in controllers.
- Mass assignment exposure —
$request->all()passed directly tocreate().$guarded = []on models. Missing$fillablearrays. No FormRequest to whitelist fields. An attacker injectsis_admin=trueand the application blindly saves it. - Architecture violations —
env()calls in application code (breaks afterconfig:cache). MissingDB::transaction()on multi-model writes. Untyped properties and methods. No query scopes. No API Resources. Events firing before transaction commits.
How It Works
Laravel Excellence Prover uses 5 Decision Pivots — boolean checkpoints that force the agent to prove its code meets senior-level standards:
- queryOptimized — No N+1 ANYWHERE — including Blade views. Eager loading, scopes, preventLazyLoading.
- noWorkarounds — Every solution uses the Laravel-idiomatic approach. The framework provides it — USE it.
- responsibilitySeparated — Controller handles HTTP. FormRequest validates. Service/Action executes. Model defines data. Event handles side effects.
- massAssignmentSafe — Explicit
$fillable,$request->validated(), sensitive fields excluded. - architectureRespected — FormRequests, DB transactions, typed code,
config()notenv(), route model binding, API Resources.
Why It Works
- Tool calls are obligations. The agent can ignore "use eager loading" in a system prompt. It cannot ignore a schema that demands naming every relationship access, proving no workarounds exist, and mapping the responsibility chain.
- The priority cascade. N+1 is checked first because it's the most common and damaging performance issue. A fat controller with fast queries is bad. A thin controller with N+1 is a production outage.
- Semantic traps. The engine catches Laravel-specific anti-patterns: vague claims ("follows best practices"), raw SQL without justification,
env()in application code, generic responsibility claims ("thin controllers"), and platitude conclusions. - Zero workaround tolerance. If Laravel provides a built-in solution (FormRequest, Route model binding, Policies, Events, API Resources), using a manual alternative is a REJECTION. Senior Laravel means knowing the framework deeply enough to never reinvent it.
Related Connectors
PSS-10 Stress Assessment MCP
Calculate and analyze perceived stress levels using the PSS-10 scale.
Weighted Average Calculator MCP
Predict academic performance and calculate required grades to pass subjects.
Sound Frequency Calculator MCP
Calculate musical note frequencies, Solfeggio resonances, and harmonic series.
Calorie Burn Estimator MCP
Calculate energy expenditure using MET values, body weight, and activity duration.