From cb0c43ba0b16546ca7fb2ed43ffb81f4d8283466 Mon Sep 17 00:00:00 2001 From: Bruno Fontes Date: Wed, 19 Sep 2018 21:12:48 -0300 Subject: [PATCH] Invalid product now redirect to Products.index page --- app/Http/Controllers/ProductController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/Controllers/ProductController.php b/app/Http/Controllers/ProductController.php index 39c299b..81da593 100644 --- a/app/Http/Controllers/ProductController.php +++ b/app/Http/Controllers/ProductController.php @@ -71,7 +71,7 @@ class ProductController extends Controller if (!$product) { session()->flash('danger', "The product doesn't exist or doesn't belongs to you."); - return back(); + return redirect('/product'); } return view('product.show', compact('product')); }