Hi Peter you can simply use this for POST Methods: `<form method="POST" action="{{ route('CustUpdateCart1.route', $id) }}"> @csrf
</form> ` and use this for DELETE`<form method="POST" action="{{ route('MyDelCustCart1.route', $id) }}"> @csrf @method('DELETE')
</form> `i this may fix your issue
SOLUTION:
<form method=\"Post\" action=".route('CustUpdateCart1.route', [$id])." >"
.csrf_field(). method_field('PUT') ."
<input type = 'text' name = 'quan' value = \"$quan\" style = 'width:45px;'>
<input name='_method' type='hidden' value='PUT'>
<input type=\"hidden\" value=\"$id\" name=\"id\">
<input type=\"hidden\" name=\"_token\" value=\"$token\">
<input type = 'submit' value = 'update' />
</form>
</div>
<div style = 'display:inline;float:left;margin-left:5px;'>
<form method=\"Post\" action=".route('MyDelCustCart1.route', [$id])." >"
.csrf_field(). method_field('DELETE') ."
<input type=\"hidden\" value=\"$id\" name=\"id\">
<input name=\"_method\" type=\"hidden\" value=\"DELETE\">
<input type=\"hidden\" name=\"_token\" value=\"$token\">
<input type = 'submit' value = 'delete' onclick = 'return confirm(\"are you sure you want to remove this item\");'/>
</form>
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community