<?php

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

Route::get('/', function () {
    return view('welcome');
});



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

use App\Http\Controllers\TimbanganController;

// Halaman utama timbangan & realtime data
Route::get('/timbangan', [TimbanganController::class, 'index'])->name('timbangan.index');
Route::get('/timbangan-data', [TimbanganController::class, 'getRealtimeData'])->name('timbangan.data');

// Simpan data pemeriksaan (form biasa)
Route::post('/timbangan', [TimbanganController::class, 'store'])->name('timbangan.store');

// Simpan data dengan analisis AI (form fetch)
Route::post('/analisis-ai', [TimbanganController::class, 'analisisAI'])->name('analisis.ai');

// Halaman analisis AI manual (jika ada)
Route::get('/analisisai', [TimbanganController::class, 'showAnalisis'])->name('analisisai');

// Tombol kembali dari analisis
Route::get('/timbangan/kembali', [TimbanganController::class, 'kembali'])->name('timbangan.kembali');



use App\Http\Controllers\RiwayatPemeriksaanController;

Route::get('/riwayat-pemeriksaan', [RiwayatPemeriksaanController::class, 'index'])->name('riwayat.index');
Route::post('/riwayat-pemeriksaan', [RiwayatPemeriksaanController::class, 'store'])->name('riwayat.store');
Route::get('/riwayat-pemeriksaan/{id}/edit', [RiwayatPemeriksaanController::class, 'edit'])->name('riwayat.edit');
Route::put('/riwayat-pemeriksaan/{id}', [RiwayatPemeriksaanController::class, 'update'])->name('riwayat.update');
Route::delete('/riwayat-pemeriksaan/{id}', [RiwayatPemeriksaanController::class, 'destroy'])->name('riwayat.destroy');



use App\Http\Controllers\BalitaController;

Route::get('/pendaftaran-balita', [BalitaController::class, 'create'])->name('balita.create');
Route::post('/pendaftaran-balita', [BalitaController::class, 'store'])->name('balita.store');
Route::get('/balita', [BalitaController::class, 'index'])->name('balita.index');
Route::get('/balita/{id}', [BalitaController::class, 'show'])->name('balita.show');
Route::get('/balita/{id}/edit', [BalitaController::class, 'edit'])->name('balita.edit');
Route::delete('/balita/{id}', [BalitaController::class, 'destroy'])->name('balita.destroy');
Route::put('/balita/{id}', [BalitaController::class, 'update'])->name('balita.update');



use App\Http\Controllers\GrafikPertumbuhanController;

Route::get('/grafik-pertumbuhan', [GrafikPertumbuhanController::class, 'index'])->name('grafik.pertumbuhan');



