即使已定义,也找不到路线

Route not found even though It's defined

这是我推出的错误 (视图:路线 [user.profile] 未定义。(视图:D:\Programi\XAMPP\htdocs\crushapp\resources\views\layouts\base.blade.php)

但是我的路线在这里很明确:

use App\Http\Livewire\User\ProfileComponent;
Route::middleware(['auth:sanctum','verified'])->group(function()
{
    Route::get('/user/profile',ProfileComponent::class)->name('user.profile');
    
});

错误来自布局,即:

<span><i class="fa fa-user-circle-o" aria-hidden="true"></i> <a href="{{ route('user.profile') }}">{{ Auth::user()->name }}  ‎‎‏‏‎ ‎‎‏‏</a></span>

有什么想法吗?

更新:我尝试在用户下定义的任何新路线都不起作用...

首先你在你的路线中缺少一个函数名称 还有 运行 php artisan route:clear

Route::get('/user/profile',ProfileComponent::class, 'index')->name('user.profile')