diff --git a/routes/web.php b/routes/web.php index 8bdca1f..a87a229 100644 --- a/routes/web.php +++ b/routes/web.php @@ -36,6 +36,7 @@ Route::any("/logout", [LoginController::class, "logout"])->name("logout"); Route::post("/product/{product}/addToCart", [CartController::class, "addToCart"])->name("addToCart")->middleware("auth"); Route::post("/product/{product}/removeFromCart", [CartController::class, "removeFromCart"])->name("removeFromCart")->middleware("auth"); -Route::resource("product", ProductController::class); +Route::resource("product", ProductController::class)->middleware("auth.admin"); +Route::resource("product", ProductController::class)->only(["show"]); Route::resource("order", OrderController::class)->middleware("auth"); Route::resource("image", ImageController::class)->only(["store", "delete", "create"])->middleware("auth.admin");