halilcosdu/laravel-slower
Detects slow Laravel database queries, logs them, and uses optional AI recommendations to suggest indexes and other optimizations. Configure thresholds, enable/disable monitoring, and run with Laravel 10–13 on PHP 8.2+ for actionable performance insights.
SLOWER_THRESHOLD).pg_stat_statements (PostgreSQL) or manual EXPLAIN ANALYZE.*"Laravel Slower is a low-code solution to automate database optimization, reducing technical debt and improving system reliability. By identifying slow queries and leveraging AI to suggest indexing strategies, we can:
- Cut cloud costs by 15–30% (e.g., downsizing database tiers).
- Accelerate feature launches by pre-emptively optimizing critical paths.
- Reduce support tickets from performance-related outages. The package integrates seamlessly with our Laravel stack, with a one-time setup cost (~$50–$100 for OpenAI API credits) and recurring savings from optimized queries. Competitors like Blackfire require manual expertise and lack AI-driven recommendations."*
Ask: "Would you prioritize this as a 3-month initiative to offset infrastructure costs?"
*"Laravel Slower eliminates guesswork in query tuning by:
- Capturing slow queries (>10ms by default) with full context (bindings, EXPLAIN plans).
- Generating AI-powered recommendations for indexes, data types, and query rewrites (e.g., fixing
WHERE id = '1'→WHERE id = 1).- Integrating into our workflow:
- Scheduled analysis: Daily
slower:analyzecommand processes logged queries.- Actionable output: SQL snippets ready for PRs (e.g.,
CREATE INDEX idx_product_prices ON product_prices (product_id, price)).- Extensible: Disable AI for offline use or customize prompts for domain-specific needs.
Why not build this?
- 3–5 dev days to replicate core features (logging + EXPLAIN parsing).
- No AI expertise needed—uses OpenAI’s pre-trained models.
- Future-proof: Roadmap includes auto-indexing and FilamentPHP UI.
Next steps:
- Pilot: Install in staging, set threshold to 50ms, and run for 2 weeks.
- Review: Audit top 5 slowest queries and estimate impact.
- Scale: Enable in production with manual review of AI suggestions."*
Ask: "Can we allocate 1 sprint to integrate this and validate ROI on 3 critical endpoints?"
Key Metrics to Track Post-Adoption:
How can I help you explore Laravel packages today?