To move the app/Nova folder to src/Domain/Laravel/Nova, you need to update the NovaServiceProvider to point to the new location.
- Move the
app/Novafolder tosrc/Domain/Laravel/Nova. - Open
NovaServiceProvider.phplocated inapp/Providers. - Update the
registermethod to point to the new location:
public function register()
{
Nova::serving(function (ServingNova $event) {
Nova::script('nova', __DIR__.'/../../src/Domain/Laravel/Nova/js/app.js');
Nova::style('nova', __DIR__.'/../../src/Domain/Laravel/Nova/css/app.css');
});
}
- Update the
bootmethod to point to the new location:
public function boot()
{
$this->loadViewsFrom(__DIR__.'/../../src/Domain/Laravel/Nova/resources/views', 'nova');
$this->app->booted(function () {
$this->routes();
});
}
- Finally, update the
composer.jsonfile to autoload the new location:
"autoload": {
"psr-4": {
"App\": "app/",
"Domain\Laravel\Nova\": "src/Domain/Laravel/Nova/src/"
},
"classmap": [
"database/seeds",
"database/factories"
]
},
- Run
composer dump-autoloadto update the autoloader.
Now you should be able to access Nova from the new location.