Skip to content

Commit 0fade92

Browse files
committed
feat: Create function to delete single product
1 parent ada80f6 commit 0fade92

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

app/Http/Controllers/ProductController.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,12 @@ public function update($id, Request $request)
4040
$product->update($request->all());
4141
return response()->json('Product updated!');
4242
}
43+
44+
/* function to delete single product */
45+
public function destroy($id)
46+
{
47+
$product = Product::find($id);
48+
$product->delete();
49+
return response()->json('Product deleted!');
50+
}
4351
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy