<?php

use Illuminate\Support\Facades\Route;
use App\Http\Controllers\SitemapController;

Route::get('/storage-link', function () {
    Artisan::call('storage:link');
    return back();
})->name('storage.link');


// Homepage - consolidated to single URL
Route::get('/', App\Livewire\Home::class)->name('home');

// Sitemap
Route::get('/sitemap.xml', [SitemapController::class, 'index']);

// Blog Routes
Route::prefix('blog')->name('blogs.')->group(function () {
    Route::get('/', App\Livewire\BlogList::class)->name('index');
    Route::get('/category/{category}', App\Livewire\BlogList::class)->name('category');
    Route::get('/{blog:slug}', App\Livewire\BlogDetail::class)->name('show');
});

// About Us Route
Route::get('/about-us', App\Livewire\AboutUs::class)->name('about-us');

// Portfolio Route
Route::get('/portfolio', App\Livewire\Portfolios::class)->name('portfolio');

// Cart Route
Route::get('/cart', App\Livewire\Cart::class)->name('cart');

// Quote Route
Route::get('/request-quote', App\Livewire\RequestQuote::class)->name('request-quote');

// Contact Route
Route::get('/contact', App\Livewire\Contact::class)->name('contact');

// Services Routes
Route::prefix('services')->name('services.')->group(function () {
    Route::get('/', App\Livewire\Services::class)->name('index');
    Route::get('/category/{slug}', App\Livewire\ServicesByCategory::class)->name('category');
    Route::get('/detail/{slug}', App\Livewire\ServiceDetail::class)->name('show');
});

// Industries Routes
Route::prefix('industries')->name('industries.')->group(function () {
    Route::get('/{slug}', App\Livewire\IndustriesByCategory::class)->name('category');
});