<?php

use App\Http\Controllers\Admin\DashboardController;
use App\Http\Controllers\Admin\ProductCategoryController;
use App\Http\Controllers\Admin\ProductController;
use App\Http\Controllers\Admin\OrderController;
use App\Http\Controllers\Admin\OrderDetailController;
use App\Http\Controllers\Admin\CustomerController;
use App\Http\Controllers\Admin\ArticleController;
use App\Http\Controllers\Admin\CarouselController;
use App\Http\Controllers\Admin\AboutController;
use App\Http\Controllers\Admin\ContactController;

Route::namespace('Admin')->middleware(['auth', 'verified'])->prefix('/admin')->name('admin.')->group(function(){
    Route::get('/', [DashboardController::class, 'index'])->name('/');
    Route::get('/dashboard', [DashboardController::class, 'index'])->name('dashboard');

    Route::get('product_category', [ProductCategoryController::class, 'index'])->name('product_category');
    Route::get('product_category/create', [ProductCategoryController::class, 'create'])->name('product_category.create');
    Route::post('product_category', [ProductCategoryController::class, 'insert'])->name('product_category.insert');
    Route::get('product_category/{product_category}', [ProductCategoryController::class, 'edit'])->name('product_category.edit');
    Route::put('product_category', [ProductCategoryController::class, 'update'])->name('product_category.update');
    Route::delete('product_category', [ProductCategoryController::class, 'delete'])->name('product_category.delete');

    Route::get('product', [ProductController::class, 'index'])->name('product');
    Route::get('product/create', [ProductController::class, 'create'])->name('product.create');
    Route::post('product', [ProductController::class, 'insert'])->name('product.insert');
    Route::get('product/{product}', [ProductController::class, 'edit'])->name('product.edit');
    Route::put('product', [ProductController::class, 'update'])->name('product.update');
    Route::delete('product', [ProductController::class, 'delete'])->name('product.delete');

    Route::get('order', [OrderController::class, 'index'])->name('order');
    Route::get('order/{order}', [OrderController::class, 'edit'])->name('order.edit');
    Route::put('order', [OrderController::class, 'update'])->name('order.update');
    Route::delete('order', [OrderController::class, 'delete'])->name('order.delete');

    Route::get('order/order_detail/{order}', [OrderDetailController::class, 'index'])->name('order.order_detail');
    
    Route::get('customer', [CustomerController::class, 'index'])->name('customer');
    Route::delete('customer', [OrderController::class, 'delete'])->name('customer.delete');

    Route::get('article', [ArticleController::class, 'index'])->name('article');
    Route::get('article/create', [ArticleController::class, 'create'])->name('article.create');
    Route::post('article', [ArticleController::class, 'insert'])->name('article.insert');
    Route::get('article/{article}', [ArticleController::class, 'edit'])->name('article.edit');
    Route::put('article', [ArticleController::class, 'update'])->name('article.update');
    Route::delete('article', [ArticleController::class, 'delete'])->name('article.delete');

    Route::get('carousel', [CarouselController::class, 'index'])->name('carousel');
    Route::get('carousel/create', [CarouselController::class, 'create'])->name('carousel.create');
    Route::post('carousel', [CarouselController::class, 'insert'])->name('carousel.insert');
    Route::get('carousel/{carousel}', [CarouselController::class, 'edit'])->name('carousel.edit');
    Route::put('carousel', [CarouselController::class, 'update'])->name('carousel.update');
    Route::delete('carousel', [CarouselController::class, 'delete'])->name('carousel.delete');

    Route::get('about', [AboutController::class, 'index'])->name('about');
    Route::put('about', [AboutController::class, 'update'])->name('about.update');

    Route::get('contact', [ContactController::class, 'index'])->name('contact');
    Route::put('contact', [ContactController::class, 'update'])->name('contact.update');

    
});

