'Laravel Delete function not working using ajax
Hi im using datatable and need to delete multiple data using checkbox, I'm using post method javascript,
Controller
public function deleteselected(Request $request){
$ids = $request->ids;
Product::whereIn('id', $ids)->delete();
return response()->json(['code'=>1, 'msg'=>'Products have been deleted from database']);
}
Javascript
$.post(url,{countries_ids:checkedCountries, _token: "{{ csrf_token() }}", _method: "POST"},function(data){
if(data.code == 1){
$('#geniustable').DataTable().ajax.reload(null, true);
toastr.success(data.msg);
}
},'json');
Error
{
"message": "Function () does not exist",
"exception": "ReflectionException",
"file": "/var/www/html/lifespace/project/vendor/laravel/framework/src/Illuminate/Routing/RouteSignatureParameters.php",
"line": 22,
"trace": [
{
"file": "/var/www/html/lifespace/project/vendor/laravel/framework/src/Illuminate/Routing/RouteSignatureParameters.php",
"line": 22,
"function": "__construct",
"class": "ReflectionFunction",
"type": "->"
},
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
