What problem does it solve?
Identifies performance, correctness, and maintainability issues in Laravel Eloquent usage so teams can reduce query bloat, fix hidden N+1s, avoid large memory usage, and make model code safer and more predictable.
Core Features & Use Cases
- N+1 Detection: Locate relationship access patterns in controllers, Blade templates, components, and accessors that cause N+1 queries and recommend eager loading or withCount/withSum alternatives.
- Query Efficiency: Flag filtering done in PHP after get/all, missing select column constraints in API responses, and large resultset hydration in jobs/commands that should use chunk, cursor, or lazy.
- Model Correctness: Highlight missing or incorrect casts, mass-assignment risks, absent uniqueness constraints for upserts, transaction gaps for multi-step writes, unsafe convenience helper usage, and $with over-fetching.
- Operational Guidance: Tie findings to migrations where possible, classify severity, and provide actionable suggestions such as using with(), withCount(), select(), DB::transaction(), Model::shouldBeStrict(), and Prunable traits.
- Use Case: Run a repository scan to produce a findings-by-category report showing file locations, severity, and concrete code-level remediation advice for each issue.
Quick Start
Audit the Laravel repository for Eloquent issues and return a structured report with file-level evidence, severities, and suggested fixes for N+1s, casts, mass-assignment, large-memory loads, and relationship anti-patterns.