<?php

use Illuminate\Support\Facades\Route;
use App\Http\Controllers\UmumController;
use App\Http\Controllers\AuthController;
use App\Http\Controllers\DashboardController;
use App\Http\Controllers\DailyPlannerController;
use App\Http\Controllers\RecipesController;
use App\Http\Controllers\BookmarkController;
// Rute yang tidak memerlukan otentikasi
Route::middleware(['guest'])->group(function () {
    Route::get('/login', [AuthController::class, 'login'])->name('login');
    Route::post('/login/auth', [AuthController::class, 'authenticate'])->name('login.auth');
    Route::get('/register', [AuthController::class, 'register'])->name('register');
    Route::post('/register/store', [AuthController::class, 'store'])->name('register.store');
});

// Rute untuk logout
Route::get('/logout', [AuthController::class, 'logout'])->name('logout');

// Rute yang memerlukan otentikasi
Route::middleware(['auth'])->group(function () {
    Route::get('/dashboard', [DashboardController::class, 'index'])->name('dashboard');
    Route::get('/kalkulator-sehat', [UmumController::class, 'kalkulatorSehat'])->name('kalkulator-sehat');
    Route::get('/kalkulator-uang', [UmumController::class, 'kalkulatorUang'])->name('kalkulator-uang');

    Route::resource('/perencana-harian', DailyPlannerController::class);
    Route::resource('/resep', RecipesController::class);
    Route::resource('/bookmarks', BookmarkController::class);
    Route::get('/kalender', function () {
        return view('calender.calender');
    })->name('kalender');
});
