我RouteCollection.php
我得到MethodNotAllowedHttpException在RouteCollection.php
得到錯誤信息MethodNotAllowedHttpException
這裏是service.blade.php
<form ACTION="{{ url('backend/client/updateservice') }}" METHOD="POST" id="form1" name="form1" >
<input type="hidden" name="_token" value="{{ csrf_token() }}">
</form>
這裏是route.php
Route::get('backend/client/editservice','Backend\[email protected]');
Route::post('backend/client/updateservice','Backend\[email protected]');
這裏是ClientController .php
public function editservice()
{
$client = Client::where('ClientID','1') -> get() -> first();
return view('backend/client.service',compact('client'));
}
public function updateservice()
{
$clientUpdate = Input::all();
$client = Client::where('ClientID','1') -> get() -> first();
$client ->update($clientUpdate);
return redirect('backend/client/service');
}
嘗試改變方法名getEditservice和postUpdateservice和路線也。 – rahulsm
請檢查表單已提交的完整錯誤,然後檢查路由中該URL的方法。 –