naif/nova-mysql
A Laravel Nova integration for MySQL that lets you inspect and manage your database from the admin panel. Browse tables, run queries, and handle routine database tasks without leaving Nova, keeping your workflow in one place.
Install via Composer:
composer require naif/nova-mysql
Register the tool in app/Providers/NovaServiceProvider.php inside tools():
public function tools()
{
return [
new \Naif\MysqlServerManagement\MysqlServerManagement(),
];
}
Then run php artisan vendor:publish (check the package README or src/ for the exact provider/class name — small packages often change namespaces between releases), and, if the tool ships uncompiled assets, run its build (npm install && npm run dev in the tool's vendor folder or a copied nova-components/ directory). php artisan nova:publish if Nova's own assets need refreshing.
Look first at:
vendor/naif/nova-mysql/composer.json — the Nova version constraint. The last release is 2018-11-09, so it almost certainly targets Nova 1.x.src/ — confirm the tool class name and whether there's a config file.routes/api.php — the routes the tool registers under /nova-vendor/....First use case: server-side inspection from the admin UI. After a deploy, open the tool to check that a migration touched the right tables, confirm a seeded row landed, or run a one-off SELECT — without opening a MySQL client or SSH tunnel. It is a convenience layer over the Nova admin surface, not a general query workbench.
Before investing time, confirm Nova compatibility. If you're on Nova 4/5, expect the tool to fail to boot or render blank.
Register conditionally, not universally. Keep the tool out of production by default — it exposes raw database surface inside your admin panel:
public function tools()
{
return $this->app->environment(['local', 'staging'])
? [new MysqlServerManagement()]
: [];
}
Guard with a gate, not just Nova's login. Every person who can reach /nova should not be able to poke the database. Define a viewMysqlServerManagement gate in AuthServiceProvider and have the tool's menu entry respect it (or override authorize() if the tool extends Nova's Tool).
Constrain by DB user. You cannot rely on the package to enforce read-only. For production/staging use a dedicated MySQL account with SELECT-only grants, and point the tool at that connection. This is the only reliable guardrail against accidental writes from an old, lightly-maintained UI.
Multi-connection apps. If your config/database.php defines several connections (tenant DB, reporting replica, legacy DB), check whether the tool hardcodes database.connections.mysql or exposes a picker. If hardcoded, fork and add a config array of allowed connections rather than patching vendor files on every deploy.
Complement, don't replace, Nova resources. For repeatable inspections ("show me recent orders") build a Nova Resource or Lens. Reserve this tool for ad-hoc inspection. Don't write runbooks that depend on it.
Fork-into-nova-components/ as the upgrade path. On any Nova major bump, replace the vendor dependency with php artisan nova:tool mysql-server-management and copy the package's Vue + controller logic in. You'll own the code, but you'll also be able to fix it when Nova's tool API moves.
composer require will likely fail or pull an old Nova. Read composer.json in the repo first — you may need to composer require with --ignore-platform-reqs or manually clone.ls vendor/naif/nova-mysql/src and use the actual class name in tools(). The README is a starting hint, not documentation.node-sass etc. Use the prebuilt dist/js bundle if possible; otherwise rebuild with sass (dart-sass) and vue-loader v15.storage/logs/laravel.log for 404s on /nova-vendor/... routes — that usually means the tool's provider wasn't loaded or its route file is stale.vendor:publish --provider=... returns nothing, the provider likely doesn't define a publish tag; check src/Providers/ for publishes() and add your own config file reading config('nova-mysql.*') if you need overrides.Authorize). Inspect the package's routes/api.php and re-register under Nova's expected prefix.How can I help you explore Laravel packages today?