我想了解Eloquent中的CRUD,但我在這裏有一些問題。使用Eloquent更新我的數據庫
我的,我沒有使用默認的控制指標,創建,存儲的第一個錯誤,...
我做了我自己的名字。
OK讓我告訴我的控制器和路線
路線
Route::get('edit-about', array('before' => 'admin_auth', 'uses' => '[email protected]', 'as'=>'edit-about'));
Route::put('edit-content', array('before' => 'admin_auth', 'uses' => '[email protected]'));
控制器
public function updateAbout()
{
$text_area = Text_area::find(1);
return View::make('admin.editText.about', compact('text_area'));
}
public function editAboutContent()
{
$id = Input::get('id');
Text_area::updated($id, array(
'titleArabic' => Input::get('title'),
'contentArabic' => Input::get('content')
));
return Redirect::to('edit-about');
}
現在顯示的第一途徑是OK edit-about
但來到第二路線
Route::put('edit-content', array('before' => 'admin_auth', 'uses' => '[email protected]'));
我得到
的Symfony \分量\ HttpKernel \異常\ MethodNotAllowedHttpException
的路線是不存在的。
編輯
這裏是我的表頭
{{ Form::open(array('url'=>'edit-content', 'PUT')) }}
你可以請發表您的形式的HTML。 我的建議是,您發送表單作爲POST而不是PUT。 – xAoc
@xAoc我更新我的問題,謝謝 –