halilcosdu/laravel-slower
Laravel Slower captures your slowest database queries and uses AI (OpenAI, Claude, Gemini, or custom models) to suggest indexes and rewrites, with a built-in dashboard at /slower and no frontend setup.
Controller@action, queue job, or artisan command, plus the first file:line in your own code. That converts a vague platform concern into a named feature owner and a specific backlog ticket — which is the difference between a perf initiative that ships and one that stalls.DB::listen hook — it's the dashboard, fingerprinting/grouping algorithm, AI prompt construction, provider abstraction, privacy redaction, sampling and circuit breaking. That is weeks of internal work plus permanent maintenance. Buying (at MIT license, zero contract) is the right call unless you already own an APM with query-level insight.EXPLAIN. This lets you make a real "can we use LLM tooling on production query data?" call with legal/security rather than answering it from vibes.analyze_pending_limit), and an optional queue. That's enough knobs to decide "who can trigger analysis, how many at a time, and does it block a request" as a policy rather than a surprise invoice.SLOWER_SAMPLE_RATE, SLOWER_MAX_PER_EXECUTION, and the circuit breaker let you decide to leave capture on under real traffic, on a representative fraction, without accepting an unbounded write-amplification risk on the primary database. That turns "instrument prod or not" into a tuning exercise.slower:clean plus a documented warning that captures can contain user data and secrets makes a retention window a first-class decision to write down, not an afterthought.SlowQueryCaptured and SlowQueryFirstSeen events let you route into Slack/PagerDuty/mail in a few lines, so you're not committing your incident workflow to this vendor's UI.Adopt when most of these are true:
local only; production requires an explicit viewSlower gate — that's a deliberate, sensible friction you should plan for, not fight.Look elsewhere when:
DB::listen — weigh that against Laravel Telescope/Pulse or the raw slow query log.slow_logs table are unwelcome — or where the schema-permission requirement for safe EXPLAIN conflicts with your least-privilege DB roles.To executives (one paragraph): We have database performance pain that we currently diagnose by hand, which means the fix cost lands on senior engineers and the detection cost lands on customers. Laravel Slower is a free, MIT-licensed Laravel package that captures queries crossing a latency threshold, groups repeats into single ranked problems, records which feature and code location produced each one, and uses an LLM to propose indexes and rewrites — surfaced in a built-in dashboard with no frontend work. The ask is small: two install commands, one gate definition, and a privacy review of the default payload (parameterized SQL and schema only — no user values unless we explicitly opt in). The return is shorter time-to-diagnosis, a ranked and owner-attributed perf backlog, and less DBA dependency. The risks are equally clear and manageable: it's a young, single-maintainer package, so we pin versions and keep it out of the critical path; it is a diagnostic, not an APM or an SLO source, so we don't retire existing monitoring; and LLM analysis is a metered call, so it runs on a queue with caps and a named owner. Success is measured by number of slow-query groups closed, p95 improvement on the target endpoints, and time-to-diagnosis per incident — not by "it's installed."
To engineering (short form): composer require halilcosdu/laravel-slower, publish migrations, migrate — dashboard at /slower, gated exactly like Telescope/Horizon (Gate::define('viewSlower', ...)), local-only by default. Grouped view for triage, origin context for ownership, per-query AI analysis with a rendered recommendation. Production-safe by design: sampling, per-execution cap, circuit breaker on log-write failure, self-capture guard. Flip SLOWER_ANALYZE_QUEUE so a 30-second LLM round-trip never blocks a request, subscribe to SlowQueryFirstSeen for Slack, and schedule slower:clean for retention. Provider is one env var (OpenAI/Anthropic/Gemini/custom via Prism) — no lock-in.
How can I help you explore Laravel packages today?