how to delete multiple records in laravel code example
Example 1: How to Delete Multiple Records using Checkbox in Laravel
public function deleteAll(Request $request)
{
$ids = $request->ids;
DB::table("products")->whereIn('id',explode(",",$ids))->delete();
return response()->json(['success'=>"Products Deleted successfully."]);
}
//@sujay
Example 2: laravel delete multiple rows
$org->products()->whereIn('id', $ids)->delete()