Protect cart with an auth middleware
This commit is contained in:
parent
4be804f1f9
commit
7ddc4f1458
1 changed files with 3 additions and 3 deletions
|
@ -33,9 +33,9 @@ Route::post('/login', [LoginController::class, "authenticate"])->name("login");
|
|||
Route::post('/register', [LoginController::class, "register"])->name("register");
|
||||
Route::any("/logout", [LoginController::class, "logout"])->name("logout");
|
||||
|
||||
Route::post("/product/{product}/addToCart", [CartController::class, "addToCart"])->name("addToCart");
|
||||
Route::post("/product/{product}/removeFromCart", [CartController::class, "removeFromCart"])->name("removeFromCart");
|
||||
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("order", OrderController::class);
|
||||
Route::resource("order", OrderController::class)->middleware("auth");
|
||||
Route::resource("image", ImageController::class)->only(["store", "delete", "create"])->middleware("auth.admin");
|
||||
|
|
Loading…
Reference in a new issue