Invalid product now redirect to Products.index page

This commit is contained in:
Bruno F. Fontes 2018-09-19 21:12:48 -03:00
parent aebffe304f
commit cb0c43ba0b

View File

@ -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'));
}