<?php

use App\Http\Controllers\Web\HomeController;
use App\Http\Controllers\Web\ProductController;
use App\Http\Controllers\Web\CartController;
use App\Http\Controllers\Web\CheckoutController;
use App\Http\Controllers\Web\OrderController;
use App\Http\Controllers\Web\ProfileController;
use App\Http\Controllers\Web\AddressController;
use App\Http\Controllers\Web\ArticleController;
use App\Http\Controllers\Web\DiscountController;

Route::namespace('Web')->group(function(){
    Route::get('/', [HomeController::class, 'index'])->name('/');
    Route::get('/home', [HomeController::class, 'home'])->name('home');

    Route::get('/product', [ProductController::class, 'index'])->name('product');
    Route::get('/discount', [DiscountController::class, 'index'])->name('discount');
    Route::get('/product/{product}', [ProductController::class, 'detail'])->name('product.detail');

    Route::get('/home', [HomeController::class, 'home'])->name('home');

    Route::get('/cart', [CartController::class, 'index'])->name('cart');
    Route::post('/cart', [CartController::class, 'insert'])->name('cart.insert');
    Route::delete('/cart', [CartController::class, 'delete'])->name('cart.delete');

    Route::post('/order', [OrderController::class, 'order'])->name('order.insert');
    Route::get('/checkout', [CheckoutController::class, 'index'])->name('checkout');
    
    Route::get('/profile', [ProfileController::class, 'index'])->name('profile');
    Route::get('/order', [OrderController::class, 'index'])->name('order');
    Route::get('/shipping_address', [AddressController::class, 'index'])->name('shipping_address');
    Route::post('/shipping_address', [AddressController::class, 'insert'])->name('shipping_address.insert');

    Route::get('/article', [ArticleController::class, 'index'])->name('article');
    Route::get('/article/{article}', [ArticleController::class, 'detail'])->name('article.detail');

});
