我分組profile
控制器,我想鏈接到。然後我定義這條路線:Laravel鏈接路徑沒有定義
//Group to put all the routes that need login first
Route::group(array('prefix'=> 'admin', 'before' => 'csrf'), function(){
Route::resource('/profile' , 'ProfileController', array('as'=>'profile'));
});
,這是我的菜單鏈接:
<li><a href="{{ URL::route('admin.profile') }}">profile Managment</a></li>
和route
在終端這一點,我的結果:
+--------+----------------------------------+------------------------+---------------------------+----------------+---------------+
| Domain | URI | Name | Action | Before Filters | After Filters |
+--------+----------------------------------+------------------------+---------------------------+----------------+---------------+
| | GET/ | index | Closure | | |
| | GET admin/index | dashboard | Closure | | |
| | GET logout | logout | Closure | | |
| | POST auth | auth | Closure | csrf | |
| | GET login | login | Closure | | |
| | GET admin/profile | admin..profile.index | [email protected] | csrf | |
| | GET admin/profile/create | admin..profile.create | [email protected] | csrf | |
| | POST admin/profile | admin..profile.store | [email protected] | csrf | |
| | GET admin/profile/{profile} | admin..profile.show | [email protected] | csrf | |
| | GET admin/profile/{profile}/edit | admin..profile.edit | [email protected] | csrf | |
| | PUT admin/profile/{profile} | admin..profile.update | [email protected] | csrf | |
| | PATCH admin/profile/{profile} | | [email protected] | csrf | |
| | DELETE admin/profile/{profile} | admin..profile.destroy | [email protected] | csrf | |
+--------+----------------------------------+------------------------+---------------------------+----------------+---------------+
現在我得到這個錯誤:
ErrorException
Route [admin.profile] not defined. (View: /var/www/alachiq/app/views/back_end/menu.blade.php) (View: /var/www/alachiq/app/views/back_end/menu.blade.php) (View: /var/www/alachiq/app/views/back_end/menu.blade.php)
在你的路線名admin配置文件註冊爲「admin..profile」用雙點。我認爲是與「/ profile文件」嘗試「曲線」 – luxcem