Including FlashMessage Model

This commit is contained in:
2018-09-20 00:18:30 -03:00
parent 1f23753f70
commit b99f6a5b68
4 changed files with 24 additions and 7 deletions

View File

@@ -6,6 +6,7 @@ use \App\Item;
use \App\User;
use \App\Product;
use Illuminate\Http\Request;
use App\FlashMessage as flash;
class ProductController extends Controller
{
@@ -70,7 +71,7 @@ class ProductController extends Controller
$product = Product::fromAuthUser()->find($id);
if (!$product) {
session()->flash('danger', "The product doesn't exist or doesn't belongs to you.");
session()->flash(flash::DANGER, "The product doesn't exist or doesn't belongs to you.");
return redirect('/product');
}
return view('product.show', compact('product'));