Nova.index route not found?
I have a snippet in a Blade template like this:
<x-nav-link :href="route('nova.index')">{{ __('Admin') }}</x-nav-link>
and artisan route:list --name=nova.index gives me:
+--------+----------+-------+------------+-----------------------------------------------------+-------------------------------------------------------+
| Domain | Method | URI | Name | Action | Middleware |
+--------+----------+-------+------------+-----------------------------------------------------+-------------------------------------------------------+
| | GET|HEAD | admin | nova.index | Laravel\Nova\Http\Controllers\RouterController@show | web |
| | | | | | Laravel\Nova\Http\Middleware\Authenticate |
| | | | | | Laravel\Nova\Http\Middleware\DispatchServingNovaEvent |
| | | | | | Laravel\Nova\Http\Middleware\BootTools |
| | | | | | Laravel\Nova\Http\Middleware\Authorize |
+--------+----------+-------+------------+-----------------------------------------------------+-------------------------------------------------------+
and yet when I render that template (even after running route:clear), I get:
Symfony\Component\Routing\Exception\RouteNotFoundException
Route [nova.index] not defined. (View: resources/views/layouts/navigation.blade.php)
Nova generally works fine apart from this. Why might it be doing this?
Inside the template, I tried this:
@php
$routeCollection = Illuminate\Support\Facades\Route::getRoutes();
foreach ($routeCollection as $value) {
dump($value->getName(), $value->getActionName());
}
@endphp
and it gives me:
null
"Laravel\Nova\Http\Controllers\LoginController@showLoginForm"
"nova.login"
"Laravel\Nova\Http\Controllers\LoginController@login"
"nova.logout"
"Laravel\Nova\Http\Controllers\LoginController@logout"
"nova.password.request"
"Laravel\Nova\Http\Controllers\ForgotPasswordController@showLinkRequestForm"
"nova.password.email"
"Laravel\Nova\Http\Controllers\ForgotPasswordController@sendResetLinkEmail"
"nova.password.reset"
"Laravel\Nova\Http\Controllers\ResetPasswordController@showResetForm"
null
"Laravel\Nova\Http\Controllers\ResetPasswordController@reset"
So, some Nova routes are defined, but not all. Why?
Please or to participate in this conversation.