Created
July 3, 2020 22:33
-
-
Save Galibri/e7d0e9c12543c0fa7a31eb543493ba65 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
public function destroy(Product $product) | |
{ | |
if($product->image) { | |
$upload_path = 'uploads/images/'; | |
File::delete($upload_path . $food->image); | |
} | |
if($product->delete()) { | |
return redirect()->back()->with('success', 'Product item deleted successfully.'); | |
} else { | |
return redirect()->back()->with('error', 'Please try again letter.'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment