我有路由资源,并且正常工作,我想将其更改为Route::controller
。Laravel使用控制器路由
但经过定义,我在php artisan route
得到错误:
+--------+------------------------------------+-----------+---------------------------------+----------------+---------------+
| Domain | URI | Name | Action | Before Filters | After Filters |
+--------+------------------------------------+-----------+---------------------------------+----------------+---------------+
| | GET index | index | Closure | | |
| | GET admin/index | dashboard | Closure | | |
| | GET logout | logout | Closure | | |
| | POST auth | auth | Closure | csrf | |
| | GET login | login | Closure | | |
| | GET admin/admin/profile/{_missing} | | [email protected] | | |
+--------+------------------------------------+-----------+---------------------------------+----------------+---------------+
我目前的路线是:
Route::resource('profile' , 'ProfileController', array('as'=>'profile'));
,我想改变这种状况到:
Route::controller('admin/profile', 'ProfileController', array('index'=>'profile.index'));
如何解决这个问题?
你看过我的quastion吗? –
我的确看过你的问题,并且我同意他们在[this]中给出了答案的人(http://stackoverflow.com/questions/19102534/laravel-4-routeresource-vs-routecontroller-which-touse)帖子。使用:: controller是不好的做法,应该避免。出于这个原因,我推荐了上面这行代码来完成你的要求。 – Patrick
和你的报价是'资源':) –