Skip to content

Commit 336c314

Browse files
author
ahmadhuss
committed
refactor: Added body of delete function ProductController.php
1 parent 54dbf17 commit 336c314

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

app/Http/Controllers/ProductController.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,8 @@ public function update(Request $request, $id)
101101
*/
102102
public function destroy($id)
103103
{
104-
//
104+
$product = Product::findOrFail($id);
105+
$product->delete();
106+
return redirect()->route('products.index');
105107
}
106108
}

0 commit comments

Comments
 (0)