app/Http/Controllers/ProductController.php
// create destroy method to delete product item
create destroy method to delete product item
create destroy method to delete product item
public function destroy($id){
        $product = Product::find($id);
        if($product == null){
            return response()->json("Product Item Not Found");    
        }
        $product->delete();
        return response()->json("product removed successfully");
    }
public function destroy ( $ id ) { $ product = Product :: find ( $ id ) ; if ( $ product == null ) { return response ( ) -> json ( " Product Item Not Found " ) ; } $ product -> delete ( ) ; return response ( ) -> json ( " product removed successfully " ) ; }
create destroy method to delete product item
create destroy method to delete product item
// get the product from db //delete the product