'Laravel Nova, route not found
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.
Solution 1:[1]
You have to clear the config cache for the changes to actually apply:
php artisan config:clear
Solution 2:[2]
Verify App\Providers\NovaServiceProvider is in your provider list.
- Go to
config/app.php
- Add
App\Providers\NovaServiceProvider::class,
to theproviders
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.
Solution 3:[3]
I ran into this problem too. Add Nova::routes();
to your routes/web.php
and reload /nova
in your browser.
Solution 4:[4]
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).
Solution 5:[5]
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"
}
}
},
Solution 6:[6]
I had the same issue. Resolved by finally remember to enable HTTP rewrite.
a2enmod rewrite
then restart apache
sudo systemctl restart apache2
Solution 7:[7]
check if the route does not require an id
for example /student/:id
Solution 8:[8]
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.
Solution 9:[9]
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));
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow