我有这样的刀片文件:
<div class="nav-item dropdown">
@if (Auth::check())
<a href="#" class="nav-link dropdown-toggle" data-toggle="dropdown">{{ Auth::user()->name }}</a>
<div class="dropdown-menu">
<a href="/profileDetail" class="dropdown-item">Profile</a>
<a href="order_history" class="dropdown-item">My Order</a>
<a href="#" class="dropdown-item" onclick="event.preventDefault(); document.getElementById('logout-form').submit();">
Logout </a>
<form id="logout-form" action="{{ route('logout') }}" method="POST" class="d-none">
@csrf
</form>
</div>
@else
<div class="nav-item dropdown">
<a href="#" class="nav-link dropdown-toggle" data-toggle="dropdown">Login</a>
<div class="dropdown-menu">
<a href="{{ route('user.login') }}" class="dropdown-item">Customer </a>
<a href="{{ route('user.register') }}r" class="dropdown-item">Register</a>
</div>
</div>
@endif
</div>
我的路由器是这样的:
/multi-auth router
Route::prefix('user') ->name ('user.') ->group (function(){
Route::middleware (['guest']) ->group (function(){
Route::view('/login', 'dashboard.user.login') ->name ('login');
Route::view('/register', 'dashboard.user.register') ->name ('register');
});
Route::middleware(['auth']) ->group(function(){
Route::view('/home', 'dashboard.user.home') ->name ('home');
});
});
我已经添加use App\Http\Controllers\UserController;
了 web.php,但我仍然发现找不到 UserController。我真的不知道我错在哪里。也许我不使用 Route::has (user.login)?
我正在使用 laravel/ui 但我已将刀片更改为我上面写的