guratr/nova-command-runner
Run Artisan commands directly from Laravel Nova. This package adds a command runner to your Nova dashboard, letting you execute and monitor artisan commands without leaving the admin panel. Quick to install and configure, it streamlines maintenance and deployment tasks for Laravel developers.
composer require guratr/nova-command-runner
app/Providers/NovaServiceProvider.php inside the tools() method:
use Guratr\NovaCommandRunner\NovaCommandRunner;
public function tools()
{
return [
new NovaCommandRunner,
];
}
php artisan vendor:publish --provider="Guratr\NovaCommandRunner\ToolServiceProvider"
Where to look first: the vendor source (vendor/guratr/nova-command-runner/src) — this is a small (43-star) package with limited public documentation, so the NovaCommandRunner class and its Vue component are the source of truth for available options and command whitelisting behavior.
First use case: running routine php artisan tasks (cache clears, queue restarts, small data migrations) without SSH access — e.g. cache:clear, config:clear, queue:restart, migrate:status. Treat it as a convenience panel for whitelisted, idempotent commands, not a general shell.
storage:link, route:cache, etc.). Anything destructive (migrate:fresh, db:wipe) should be excluded.Artisan Runner) so it lands in a sensible menu slot.canSee() on the registered tool instance:
NovaCommandRunner::make()->canSee(fn ($request) => $request->user()->isSuperAdmin()),
config:clear after editing .env is a classic — a Route/Cache/Config clear composite (single command per run) saves clicks.if (! app()->environment('production')) {
// do not register
}
canSee()/Nova authorization and never expose destructive or arbitrary-input commands.queue:restart-style fire-and-forget commands or run them via a queued job.Artisan::call() and Artisan::output(), so interactive commands (asking for confirmation) will fail or hang — avoid commands that require prompts.Artisan::call() runs in the web request's process — env vars, cwd, and loaded config may differ from a CLI shell. If a command behaves oddly from the panel but fine in terminal, suspect config:cache/env differences first.composer.json and be prepared to read/patch the source (the allowlist logic and Vue component are simple enough to fork).php artisan config:clear before assuming the tool is broken.php artisan nova:publish was run for assets and that the tool provider is auto-discovered (php artisan package:discover). Errors land in storage/logs/laravel.log — tail it while running a command from the UI.app/Nova/Tools rather than fighting the vendor package.How can I help you explore Laravel packages today?