5

I want to be able to access Laravel Nova from the root, i.e. from example.com and not example.com/nova.

I have tried changing the path setting in config/nova.php to '/'. Going to example.com then redirects to example.com/login which looks right, but it throws the following error:

No hint path defined for [nova].

I'm new to Laravel but some searching suggests this is to do with the FileViewFinder but I don't know how to resolve this. The closest answer I found suggested adding Laravel/Nova/Http/Middleware/ServeNova to the list of providers in config/app.php but this throws a new error (Call to undefined method Laravel\Nova\Http\Middleware\ServeNova::isDeferred()).

Is it possible to serve Nova from the root and if so, how?

Phil H
  • 53
  • 6

2 Answers2

5

Just change the 'path' to '/' in config/nova.php should work:

 'path' => '/',
Imran Zahoor
  • 2,521
  • 1
  • 28
  • 38
Lucas Dalmarco
  • 256
  • 2
  • 13
4

Alternatively, you can do a redirect like this in your web.php file

Route::get('/', function () {
    return redirect(config('nova.path')); 
});
Matovu Ronald
  • 782
  • 11
  • 13