10

I've installed Laravel Nova (using Laravel 5.6). App\Providers\NovaServiceProvider::class is registered in my config/app.php file. But when I go to https://localhost:1234/nova I get a 404 error.

I have cleared my caches and run a composer dump-autoload. How can I get this route working?

EDIT: When I run php artisan route:list the nova-api routes are there but there is no route for nova.

Also, the migrations were not copied across after nova:install. I am working with an existing Laravel project.

GluePear
  • 7,244
  • 20
  • 67
  • 120

9 Answers9

13

Verify App\Providers\NovaServiceProvider is in your provider list.

  • Go to config/app.php
  • Add App\Providers\NovaServiceProvider::class, to the providers

Note that this answer is relative to @jszobody's anwser and a direct answer to a question following up upon that aforementioned tweet. https://twitter.com/taylorotwell/status/1032300773655408640

Without this, it is possible to see the Nova panel, though it remains empty. A fresh install at this time will show a "Help" Card on the Dashboard.

5

I ran into this problem too. Add Nova::routes(); to your routes/web.php and reload /nova in your browser.

Andrew
  • 106
  • 3
3

You have to clear the config cache for the changes to actually apply:

php artisan config:clear
Chin Leung
  • 14,621
  • 3
  • 34
  • 58
0

From Taylor (if you are using an earlier version than Nova 1.0.1):

If you are having issues with Nova not registering a /nova route when using "php artisan serve"... try upgrading Nova and updating your route registration in your NovaServiceProvider to match this image... (add "register" on end of chain).

enter image description here

https://twitter.com/taylorotwell/status/1032298042773393408

GluePear
  • 7,244
  • 20
  • 67
  • 120
jszobody
  • 28,495
  • 6
  • 61
  • 72
0

If you have disabled Package Discovery / Autodiscover by adjusting your composer.json like so:

"extra": {
    "laravel": {
        "dont-discover": [
            "*"
        ]
    }
}

You need to add the the NovaCoreServiceProvider and Nova alias to your config/app.php manually.

'providers' => [
    Laravel\Nova\NovaCoreServiceProvider::class,
],
'aliases' => [
    'Nova' => Laravel\Nova\Nova::class,
]

If you look at the composer.json of laravel/nova in your vendor folder you can see this:

"extra": {
    "laravel": {
        "providers": [
            "Laravel\\Nova\\NovaCoreServiceProvider"
        ],
        "aliases": {
            "Nova": "Laravel\\Nova\\Nova"
        }
    }
},
Daniël de Wit
  • 2,206
  • 1
  • 16
  • 13
0

I had the same issue. Resolved by finally remember to enable HTTP rewrite.

a2enmod rewrite

then restart apache

sudo systemctl restart apache2
JAGOS
  • 1
0

check if the route does not require an id

for example /student/:id

0

I realize it has been some time since this was posted, and there are other answers, but today I encountered the same problem a fresh install seemingly out of nowhere and resolved it by adding

\Laravel\Nova\NovaCoreServiceProvider::class to the providers array in config/app.php.

After doing so, I ran artisan route:clear to clear and rebuild the route cache, and the problem was resolved.

I have no idea what could have caused this issue, as I've bootstrapped multiple new laravel projects with nova the exact same way and never encountered this issue.

Morgan
  • 867
  • 3
  • 11
  • 34
0

One option is to debug to check all Nova routes. Add the lines above in the NovaServiceProvider class boot() function.

    public function boot()
    {
        parent::boot();
        Nova::serving(function (ServingNova $event) {
            $request = $event->request;
            \Log::debug(Nova::resourceInformation($request));
        }
Fernando Borba
  • 111
  • 1
  • 5