'Layout does not load when creating a new tool in Laravel Nova

When I create a tool in Laravel Nova with

php artisan nova:tool drehimself/test-tool

And then add in NovaServiceProvider.php in the function tools, should appear a layout where showed a black hole. Only that when I press the option that appears in the menu on the left side, it shows nothing, not even the url changes.

Does anyone know what it could be?



Solution 1:[1]

Nova tools are customizable, as they primarily consist of a single-file Vue component that is totally under your control. Within your Vue component, you are free to make HTTP requests to any controller within your application.

By default the page should come with the address and a default layout like this. Image But when I do the artisan, mine doesn't look like this

You need to compile your assets first.

Go to your tool :

cd nova-components/TestTool

Then :

# Compile your assets for local development...
npm run dev

# Compile and minify your assets...
npm run prod

In addition, you may run the NPM watch command to auto-compile your assets when they are changed:

npm run watch

Refresh, you will see your tool now.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Wahyu Kristianto