Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to access Laravel Nova from the root?

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?

like image 922
Phil H Avatar asked Mar 04 '23 23:03

Phil H


2 Answers

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

 'path' => '/',
like image 190
Lucas Dalmarco Avatar answered Mar 17 '23 00:03

Lucas Dalmarco


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

Route::get('/', function () {
    return redirect(config('nova.path')); 
});
like image 24
Matovu Ronald Avatar answered Mar 17 '23 01:03

Matovu Ronald