Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Laravel Slower Laravel Package

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.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Performance roadmap prioritization. The Grouped view collapses thousands of raw captures into one row per query shape with an occurrence counter, avg/max duration and last-seen time. That gives you a defensible ranking input — "fix the highest frequency × duration group first" — instead of a pile of alerts or an engineer's anecdote. Usable as evidence in sprint planning and OKR reviews ("reduce p95 read latency on checkout by X%").
  • Attributing cost to features, not just to "the database." Origin context ties each capture to a route, 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.
  • Build vs. buy. The thing you'd otherwise build is not the 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.
  • Privacy and data-egress posture. The default payload contract is decision-grade documentation: parameterized SQL + schema + origin go out; raw SQL and bindings are explicit opt-ins; a captured user ID is never forwarded; a redactor covers every outbound path including 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.
  • AI spend governance. Analysis is a billable provider call per query, with rate limits, a cap on bulk analysis (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.
  • Production rollout decisions. 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.
  • Retention and data-minimization policy. 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.
  • Developer onboarding and autonomy. The AI recommendation is stored and rendered as markdown per query, including schema and index context. That means mid-level engineers can act on index and rewriting advice without a DBA in the loop — capacity leverage rather than a headcount ask.
  • Alerting integration without lock-in. 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.

When to Consider This Package

Adopt when most of these are true:

  • Stack fit: PHP 8.3+, Laravel 11–13. It is a Laravel-native package; there is no portability story outside it.
  • You have a concrete symptom: a known slow endpoint, a p95 regression, or a database that's become the visible bottleneck. It's a diagnostic tool, not a general monitor — value shows up fastest when you already suspect the DB.
  • You have no query-level APM: no Datadog/New Relic/Sentry DB query insight, and no appetite for per-host APM pricing. This replaces a paid tier or an internal dashboard, at MIT cost.
  • Engineering will actually read the recommendations. If nobody owns the follow-through, you'll accumulate a dashboard no one opens. Pair adoption with a named owner and a review cadence.
  • Legal/security can sign off on schema + parameterized SQL egress, or you accept the AI-disabled mode (capture and dashboard only) and use it purely as a slow-query inspector.
  • You are comfortable with a young, single-maintainer, 415-star package in a non-critical-path role: it observes and recommends, it does not sit in the request path of your business logic. Pin the version and treat upgrades as reviewed changes.
  • You treat it as non-production or gate-protected in production. Default access is local only; production requires an explicit viewSlower gate — that's a deliberate, sensible friction you should plan for, not fight.

Look elsewhere when:

  • You need an SLI/SLO source of truth or long-term retention. This captures only above-threshold queries, sampling makes counts approximate, and the store is a single table. It is not a metrics system and should not feed your SLA dashboards.
  • You need multi-language or infrastructure-wide coverage. No PHP/Laravel, no deal. Polyglot shops need one pane of glass.
  • Hard no-LLM-egress environments. You can run capture-only, but then you're buying a UI over DB::listen — weigh that against Laravel Telescope/Pulse or the raw slow query log.
  • You need vendor support, an SLA, security certifications, or a procurement contract. MIT + one maintainer means bus factor and no escalation path. Note the dependents count is zero and the maintainer footprint is small; verify release cadence yourself rather than trusting the listed last-release date.
  • Extremely high write-throughput primaries where even sampled inserts into a slow_logs table are unwelcome — or where the schema-permission requirement for safe EXPLAIN conflicts with your least-privilege DB roles.
  • You already pay for query-level APM. Duplicating instrumentation and splitting attention across two dashboards usually loses.

How to Pitch It (Stakeholders)

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.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
coleus/frame
thtg88/journalism
filagora/filagora-ai-forums
rlacerda83/query-parser
socialdept/atp-orm
cboxdk/laravel-assistant-client
socialdept/atp-resolver
socialdept/tenant-domains
tautvydasr/blade-class-names
socialdept/color-scales
maherelgamil/controller
coleus/widgets
coleus/table
coleus/users
coleus/music
coleus/health
coleus/calendar
coleus/notes
coleus/support
coleus/settings