app/Http/Controllers/CategoryController.php
//    ---- remove parent and child categories(products) withe categories and products tables
remove parent and child categories(products) withe categories and products tables
remove parent and child categories ( products ) withe categories and products tables
public function categorie_Remove(Request $request){
        Category::where('id', $request->id)->delete();
        Category::where('category_id', $request->id)->delete();
        Product::where('parent_id', $request->id)->delete();
        return redirect()->back();
    }
public function categorie_Remove ( Request $ request ) { Category :: where ( 'id' , $ request -> id ) -> delete ( ) ; Category :: where ( 'category_id' , $ request -> id ) -> delete ( ) ; Product :: where ( 'parent_id' , $ request -> id ) -> delete ( ) ; return redirect ( ) -> back ( ) ; }
remove parent and child categories(products) withe categories and products tables
remove parent and child categories ( products ) withe categories and products tables