2016-06-18 3 views
0

제출 버튼을 클릭하면 MethodNotAllowedHttpException 줄이 생깁니다. 218 행이 내 경로 인 것처럼 보입니다.laravel 5.2에서 테이블을 업데이트하는 방법 012

내 블레이드 is`id ")}}"METHOD = "POST">

{{csrf_field()}} {{method_field은 (}}) "PUT는 '

<table> 
    <tr> 
     <td>Name</td> 
     <td> 
      <input type = 'text' name = 'name' value = '{{ $users->name}}'/> 
     </td> 
    </tr> 
    <tr> 
     <td colspan = '2'> 
      <input type = 'submit' value = "Update student" /> 
     </td> 
    </tr> 
</table> 

`

MY ROUTE은 IS Route::post('edit/{id}','[email protected]');

컨트롤러

public function show($id){ $users =User::findOrFail($id); return view('stud_update',['users'=>$users]); } public function edit(Request $request,$id) { dd("welcome"); $name = $request->input('name'); DB::update('update users set name = ? where id = ?',[$name,$id]); echo "Record updated successfully.<br/>"; echo '<a href = "/edit-records">Click Here</a> to go back.'; }

it doesn't diplay the welcome message 

답변

0

는 내가 경로 : 대신 경로의) (넣어 :: 포스트()를 사용하는 것이 었습니다. 지금 마법처럼 작동

관련 문제