<?php

use App\Http\Controllers\ProfileController;
use App\Modules\Pilkades\Http\Controllers\Public\SitemapController;
use Illuminate\Support\Facades\Route;

Route::get('/', function () {
    return view('corporate.home');
})->name('home');

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

Route::get('/robots.txt', function () {
    return response("User-agent: *\nAllow: /\nSitemap: ".url('/sitemap.xml'))
        ->header('Content-Type', 'text/plain');
});

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');
});

require __DIR__.'/auth.php';
