【发布时间】:2022-01-04 21:14:31
【问题描述】:
(我只是个初学者!!)
控制器:
public function destroy(Pessoa $pessoa)
{
$pessoa->delete();
return redirect("http://localhost:5500/index.html");
}
我可以使用帖子
<form action="http://127.0.0.1:8000/api/pessoas" method="POST">
但是如何使用 delete 方法呢?
【问题讨论】:
-
这能回答你的问题吗? use DELETE method in route with Laravel 5.4
-
只需添加隐藏输入
<input type="hidden" name="_method" value="delete" />或在 Blade 中,@method('delete') -
@WaseemAlhabash 我看到了这篇文章,但我使用 laravel 作为 API。问题是我想通过 html 删除列,使用
-
@miken32