1DB::table('users')->delete();
2
3DB::table('users')->where('votes', '>', 100)->delete();
1App\Post;
2$post = Post::find($id);
3Comment::where('post_id',$post)->delete();
4
1public function destroy($id)
2{
3 if (is_array($id))
4 {
5 Product::destroy($id);
6 }
7 else
8 {
9 Product::findOrFail($id)->delete();
10 }
11 // redirect or whatever...
12}
1public function deleteAll(Request $request)
2{
3 $ids = $request->ids;
4 DB::table("products")->whereIn('id',explode(",",$ids))->delete();
5 return response()->json(['success'=>"Products Deleted successfully."]);
6}
7//@sujay