这是我的路线
<?php
/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/
Route::get('/', function () {
return view('welcome');
});
Route::get('/account', 'AccountController@index')->name('account.index')->middleware('auth');
Route::get('/dashboard', 'DashboardController@index')->name('dashboard.show')->middleware('auth');
在我的仪表板上
<div class="main-menu-content">
<ul class="navigation navigation-main" id="main-menu-navigation" data-menu="menu-navigation">
<li {{ request()->route()->getName() === 'dashboard.index' ? ' class=active' : '' }}><a href="/dashboard"><i class="ft-home"></i><span class="menu-title" data-i18n="">Dashboard</span></a>
</li>
<li {{ request()->route()->getName() === 'account.index' ? ' class=active' : '' }}><a href="/account"><i class="ft-user"></i><span class="menu-title" data-i18n="">Account</span></a>
</li>
</ul>
</div>
我在这里要做的是使li课程处于活动状态,但是我尝试了上面的代码,尽管我在仪表板上但没有活动课程,而且我还检查了我在帐户中时li仍然没有突出显示为活动的。有人可以告诉我有什么问题吗?
守着一只汪
婷婷同学_