<?php

use App\Http\Controllers\ProfileController;
use App\Http\Controllers\SectionController;
use Illuminate\Support\Facades\Route;

Route::middleware(['auth', 'verified'])->group(function () {

    // Default route after login
    Route::get('/dashboard', function () {
        return view('dashboard');
    })->name('dashboar');

    Route::get('/', [SectionController::class, 'index'])->name('dashboard');

    Route::post('/hero', [SectionController::class, 'storeHero'])->name('hero.store');
    Route::post('/about', [SectionController::class, 'storeAbout'])->name('about.store');
    Route::post('/why-choose-us', [SectionController::class, 'storeWhyChooseUs'])->name('whyChooseUs.store');
    Route::post('/get-in-touch', [SectionController::class, 'storeGetInTouch'])->name('getInTouch.store');
    Route::post('/services', [SectionController::class, 'storeService'])->name('service.store');
    Route::get('/sections', [SectionController::class, 'index'])->name('sections.index');
    // 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');

});

// api routes

Route::get('/api/hero', [SectionController::class, 'getHero']);
Route::get('/api/about', [SectionController::class, 'getAbout']);
Route::get('/api/whychooseus', [SectionController::class, 'getWhyChooseUs']);
Route::get('/api/getintouch', [SectionController::class, 'getGetInTouch']);
Route::get('/api/services', [SectionController::class, 'getServices']);
require __DIR__.'/auth.php';
