【发布时间】:2018-04-20 10:25:28
【问题描述】:
我有这个Route
Route::group([ 'middleware' => ['auth','lang']], function() {
// SETTINGS
Route::namespace( 'Settings' )->prefix( 'settings' )->group( function () {
// INDEX
Route::get( '/', 'SettingsController@index' );
// ACCOUNTS
Route::resource( 'accounts', 'AccountController', ['only' => ['index','store','edit','update']] );
// TAGS
Route::resource( 'tags', 'TagController', ['only' => ['index','destroy']] );
// PROFILE
Route::get('profile', 'ProfileController@index');
Route::post('profile', 'ProfileController@update');
});
有什么方法可以将两个 PROFILE 合并为一个 resource?每当我尝试使用 Route::resource( 'profile', 'ProfileController', ['only' => ['index','update']] ) 时,它都会给我一个错误,即不允许使用该方法 - 405 (Method Not Allowed)。我认为它只是找不到update 吗?我真的不确定可能是什么问题。
【问题讨论】:
标签: php laravel post get routes