私の送信ボタンをクリックすると、MethodNotAllowedHttpExceptionが返されます。218行目は私のルートがOkだと思われます。laravelのテーブルを更新するには5.2
私のブレード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はRoute::post('edit/{id}','[email protected]');
コントローラ
ISpublic 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