laravel/nova-devtool
Laravel Nova Devtool streamlines Nova component development with a Workbench-based Nova install, optional auto-login, and commands to install common JS deps. Easily enable/disable Vue Devtools in Nova and upgrade from Nova 4 with a generic Mix extension.
composer require --dev laravel/nova-devtool
npm install --save-dev @laravel/nova-devtool
php vendor/bin/testbench nova:devtool enable-vue-devtool
testbench.yaml):
composer run serve
(Add user: nova@laravel.com to testbench.yaml under workbench to auto-login.)F12).testbench to spin up a disposable Nova environment for each feature branch.
php vendor/bin/testbench nova:devtool setup
testbench nova:devtool setup to create a fresh workbench directory.Makefile alias for convenience:
nova-test:
testbench nova:devtool setup && composer run serve
php vendor/bin/testbench nova:devtool install
(Installs Axios, Lodash, Tailwind CSS, and Vue.)package.json edits.# Enable (for debugging)
php vendor/bin/testbench nova:devtool enable-vue-devtool
# Disable (for production builds)
php vendor/bin/testbench nova:devtool disable-vue-devtool
package.json scripts:
"scripts": {
"dev": "nova enable-vue-devtool && mix",
"prod": "nova disable-vue-devtool && mix --production"
}
nova.mix.js with the devtool’s mixin (for Nova 4+):
// webpack.mix.js
let mix = require('laravel-mix');
mix.extend('nova', new require('laravel-nova-devtool'));
mix.setPublicPath('dist').nova();
nova.mix.js per component and keeps builds consistent.tsconfig.json for TypeScript projects:
php vendor/bin/testbench nova:devtool tsconfig
Webpack 5 Compatibility:
webpack 5.10.6 (fixed in v1.9.1).webpack-cli and laravel-mix:
npm update webpack-cli laravel-mix
package.json if using older Nova versions:
"devDependencies": {
"webpack-cli": "^4.10.0",
"laravel-mix": "^6.0.9"
}
Vue DevTools Not Showing:
enable-vue-devtool ran without errors.mix.js includes the devtool plugin (see Webpack Mix Integration).Workbench Authentication Failures:
testbench.yaml misconfiguration or missing user.user: nova@laravel.com is set (or use your Nova admin email).php artisan nova:auth if the user isn’t registered.NPM Dependency Conflicts:
package.json and devtool’s dependencies clash.npm install --force or resolve conflicts manually:
npm install --save-dev @laravel/nova-devtool --force
Vue Component Issues:
Build Errors:
mix --verbose to see detailed Webpack logs.php artisan cache:clear
npm run dev
Nova Service Provider:
NovaServiceProvider is registered in config/app.php:
'providers' => [
// ...
Laravel\Nova\NovaServiceProvider::class,
],
Custom Commands:
use Laravel\NovaDevtool\Console\NovaDevtoolCommand;
class CustomNovaDevTool extends NovaDevtoolCommand {
protected $signature = 'nova:custom-task';
protected $description = 'Run a custom Nova devtool task';
public function handle() {
// Add logic here
}
}
Webpack Mix Extensions:
php artisan vendor:publish --provider="Laravel\NovaDevtool\NovaDevtoolServiceProvider"
config/nova-devtool.php to adjust build settings.Workbench Automation:
testbench.yaml template by publishing devtool assets:
php artisan vendor:publish --tag="nova-devtool-assets"
resources/views/vendor/nova-devtool/testbench.yaml to add pre-configured tools (e.g., auto-installed Nova packages).Laravel 13+ Support:
v1.9.0+ for Laravel 13 compatibility. Older versions may require manual adjustments to config/nova.php.CI/CD Integration:
# .github/workflows/test.yml
- run: php vendor/bin/testbench nova:devtool enable-vue-devtool
- run: npm ci && npm run dev
Nova Upgrades:
php vendor/bin/testbench nova:devtool install --update
Performance:
disable-vue-devtool) to reduce bundle size.mix.nova() with --production flag for optimized builds.How can I help you explore Laravel packages today?