删除按钮在表中不起作用

时间:2018-01-24 15:28:05

标签: laravel-5.3

这就是我的代码的样子

   '<td class="text-center ">
     <form action="/patients/{{$patient->id}}" method="post" 
     class="delete_link">
    {{ csrf_field() }}
    {{ method_field(\'DELETE\') }}
   <button type="submit" class="btn btn-danger btn-sm pullright">Delete</button>
    </form>
   </td>'

请记住我的表格是单引号。有人帮我把这件事搞定了,拜托。!!

1 个答案:

答案 0 :(得分:0)

'<td class="text-center ">
   <form action="/patients/{{$patient->id}}" method="post" class="delete_link">
    {{ csrf_field() }}
    <input type="hidden" name="_method" value="DELETE">
    <button type="submit" class="btn btn-danger btn-sm pullright">Delete</button>
  </form>
</td>'