@pknad505 No problem. Let me save you some trouble in the future.
In case your method is not post or get you'll get an error because html forms don't support it. To solve it you'll have to add a hidden field with the method type.
Here is an example for a delete form. If it's patch then just change it to patch.
<form action="client/delete" method="post" accept-charset="UTF-8">
{{ csrf_field() }} {{ method_field('DELETE') }}
<input name="name" type="hidden" value="{{$clients->name}}">
<button type="submit" id="{{$clients->name}}" title="remove" class="button button-caution button-square button-small delete"><i class="fa fa-trash-o"></i></button>
</form>
If you're using AJAX then you will need to add a CSRF token in the page header.
<meta name="csrf_token" content="{{ csrf_token() }}"/>
This is how an AJAX delete method would look like. Of course change it to your needs
$(document).delegate(".delete", "click", function (e) {
e.preventDefault();
var id = this.id;
var removeRow = $(this).closest("tr").attr('id');
var form = $(this).parents('form:first');
var url = form.prop('action');
var conformation = confirm("Are you sure you want to delete " + id +"?");
//Stop the process if user clicks cancel
if(!conformation){
return;
}
$.ajax({
url: url,
type: "delete",
beforeSend: function (xhr) {
var token = $('meta[name="csrf_token"]').attr('content');
if (token) {
return xhr.setRequestHeader('X-CSRF-TOKEN', token);
}
},
data: {'name': id},
success:function(data){
$("#"+removeRow).remove();
toastr.success(id +" has been deleted successfully");
},error:function(){
toastr.error("Something went wrong");
}
});
});