2015-12-08 64 views
1

我目前在我的管理请求页面,网址为wwww.website.com/requests/manage/。我想回重定向到使用<a href="dashboard">dashborad</a>我的仪表板页面,但是当我点击我的仪表盘链接,则网址www.website.com/requests/manage/dashboard,而不是www.website.com/dashboardLaravel 5.1 - 重定向回基本网址

下面

是代码回到我的仪表板页面,

<td style="line-height:12pt; height:10px;"> 
     <a href="dashboard"><b class="brandname"> 
       dashboard</b> 
     </a> 
</td> 

这是我的routes.php文件。

Route::group(['middleware' => 'auth'], function() { 

    Route::get('dashboard', '[email protected]'); 

    // All about buyer request... 
    Route::post('requests/success', '[email protected]'); 
    Route::post('request/success', '[email protected]'); 

    Route::get('requests/new', '[email protected]'); 
    Route::get('request/new', '[email protected]'); 
    Route::get('requests/manage/{status?}', '[email protected]'); 

}); 

是我的尝试是增加另一个路线(见下文)来解决这个问题,但我认为是不是一个完美的解决方案。有什么建议么?

Route::get('requests/manage/dashboard', '[email protected]'); 

回答

2

用斜杠预先创建一个根相对URL。

<a href="/dashboard">dashboard</a> 

您还可以使用的辅助功能,如url来生成一个绝对的URL:

<a href="{{ url('dashboard') }}">dashboard</a> 

url辅助函数将创建一个绝对URL像http://website.com/dashboard

+0

它的工作!谢谢。 –