<?php

use App\Http\Controllers\ProfileController;
use App\Http\Controllers\AdminController;
use App\Http\Controllers\MenuCategoryController;
// routes/web.php
use App\Http\Controllers\MenuProductController;
// routes/web.php
use App\Http\Controllers\AboutUsController;
use App\Http\Controllers\GalleryController;

use App\Http\Controllers\ServiceCategoryController;
use App\Http\Controllers\ServiceProductController;
use App\Http\Controllers\UserController;
use App\Http\Controllers\MessageController;
use App\Http\Controllers\AdvertisementController;
use App\Http\Controllers\ProductController;
// routes/web.php
use App\Http\Controllers\ContactInfoController;

use App\Http\Controllers\BannerController;

use App\Http\Controllers\Admin\TeamController;
use App\Http\Controllers\Admin\ServiceProController;
use App\Http\Controllers\Admin\TestimonialController;
use App\Http\Controllers\Admin\PageBannerController
;
use App\Http\Controllers\VisitorController;



use Illuminate\Support\Facades\Route;

Route::get('/', [UserController::class, 'index']);
Route::get('/about', [UserController::class, 'about'])->name('about');
Route::get('/water-technology', [UserController::class, 'glasses'])->name('glasses');
Route::get('/pool-technology', [UserController::class, 'sunGlassess'])->name('sun-glassess');
Route::get('/our-services', [UserController::class, 'contactLense'])->name('contact-lense');
Route::get('/contact', [UserController::class, 'contact'])->name('contact');

Route::get('/men', [UserController::class, 'men'])->name('men');
Route::get('/women', [UserController::class, 'women'])->name('women');
Route::get('/child', [UserController::class, 'child'])->name('child');
Route::get('/all', [UserController::class, 'all'])->name('all');

Route::get('/product/{id}', [UserController::class, 'show'])->name('product.details');
Route::get('/services-details/{id}', [UserController::class, 'showService'])->name('services.details');

Route::post('/appointment-submit', [UserController::class, 'submitAppointment'])->name('appointment.submit');

// Route::get('/shop', [UserController::class, 'shop'])->name('shop');
// Route::get('/services', [UserController::class, 'services'])->name('services');


Route::get('/dashboard', function () {
    return view('admin/index');
})->middleware(['auth', 'verified'])->name('dashboard');

Route::get('/services/{category}', [UserController::class, 'show'])->name('services.show');
Route::post('/messages', [MessageController::class, 'store'])->name('messages.store');


Route::middleware(['auth'])->group(function () {
   
    Route::get('/admin/logout', [AdminController::class, 'Destroy'])->name('admin.logout');
    Route::resource('menu-categories', MenuCategoryController::class);
    Route::resource('menu-products', MenuProductController::class);
    Route::resource('about-us', AboutUsController::class);
    Route::resource('gallery', GalleryController::class);
    Route::resource('contact-info', ContactInfoController::class);
    Route::resource('service-categories', ServiceCategoryController::class);
    Route::resource('service-products', ServiceProductController::class);
    Route::get('/messages', [AdminController::class, 'Message'])->name('messages.index');
    Route::resource('banner', BannerController::class);
    Route::resource('advertisements', AdvertisementController::class);
    Route::resource('products', ProductController::class);
    Route::resource('teams', TeamController::class);
    // Route::resource('services_product', ServiceProController::class);
    Route::resource('services_product', ServiceProController::class)->parameters([
        'services_product' => 'service',
        
    ]);
    Route::resource('testimonials', TestimonialController::class);
    Route::resource('admin/page-banners', PageBannerController::class);
  


});

Route::middleware('auth')->group(function () {
    Route::get('/profile', [ProfileController::class, 'edit'])->name('profile.edit');
    Route::patch('/profile', [ProfileController::class, 'update'])->name('profile.update');
    Route::delete('/profile', [ProfileController::class, 'destroy'])->name('profile.destroy');
});

// Route::get('/register', function () {
//     abort(403, 'Registration is disabled.');
// })->name('register');

// Route::post('/register', function () {
//     abort(403, 'Registration is disabled.');
// });

require __DIR__.'/auth.php';
