name("main"); Route::get('/user', function () { $user = Auth::user(); return view("user", ["user"=>$user]); })->middleware("auth"); Route::view("/login", "login"); 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::resource("product", ProductController::class); Route::resource("order", OrderController::class); Route::resource("image", ImageController::class)->only(["store", "delete", "create"]);