amjadiqbal/laravel-mysql-advisor
A Laravel package that analyzes your MySQL setup and surfaces actionable advice on slow queries, indexes, and configuration so you can spot performance problems early and keep your database running efficiently.
unindexed-foreign-key and n-plus-one for ORM-driven slowness, full-table-scan and top-statements for query-plan regressions, buffer-pool-hit-ratio and disk-temp-tables for under-provisioned instances. A PM can use the report to argue for a specific infra tier or a specific sprint of index work instead of a vague "the app is slow."viewMysqlAdvisor gate defaults to local-only. That is a reasonable default, but it is a decision the PM should ratify explicitly: does production schema diagnostics get exposed to on-call, or stay on staging/pre-prod?--fail-on with exit code 1 on findings and 2 on inspection failure makes this usable as a pipeline gate. That is a policy call — gating merges on advisory findings will create friction and needs a defined severity threshold — but it's cheap insurance against reintroducing dropped indexes.redundant-index/fragmentation/stale-statistics, and onboarding documentation for engineers who don't know MySQL internals.Adopt when:
ReadOnlyGuard permitting only a single SELECT or SHOW is the right guarantee for pointing anything at production, and it makes security review short.EXPLAIN dumps.Look elsewhere or wait when:
performance_schema digests, so the query-level checks (top-statements, n-plus-one, full-table-scan) will degrade to skipped. If that's your stack, a large share of the value is gone — verify before committing.performance_schema is off or privileges are restricted on managed MySQL (common on some providers). The graceful-degradation messaging is good product behavior, but skipped checks mean skipped value. Confirm the GRANTs are obtainable in your environment first.For executives: This is a free, low-risk diagnostic that tells us which database problems are costing us performance and exactly what to change to fix them. It reads only — it cannot modify or break production — and it runs as a single command or a local dashboard with no new infrastructure, no vendor contract, and no frontend build. It buys us the kind of visibility we would otherwise staff a DBA or buy a monitoring product for, and it turns "the app feels slow" into a sized list of tickets. Honest caveat: it's a first release with 13 checks, so we should pilot it on staging for a sprint before we rely on it, and it complements rather than replaces a real monitoring tool.
For engineering: Zero-execution guarantee via ReadOnlyGuard (single SELECT/SHOW only) means it's safe to point at production. One artisan command with --only, --connection, --format=json, and --fail-on for CI; a gate-protected Blade dashboard with no asset pipeline; and a php artisan about entry. Every finding comes with the fix as SQL plus a Laravel migration or Eloquent snippet. It degrades honestly — missing privileges, performance_schema disabled, or native prepared statements produce a skipped check with the reason and the exact GRANT or setting needed, rather than a silent false negative. Ask: is v0.1.0 acceptable as a dependency, and can we get the required grants in each environment?
How can I help you explore Laravel packages today?