<?php

use App\Http\Controllers\DashboardController;
use App\Http\Controllers\User\AgendaController;
use App\Http\Controllers\KategoriController;
use App\Http\Controllers\KategoriDokumenController;
use App\Http\Controllers\RoleController;
use Illuminate\Support\Facades\Route;

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

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

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

// Data Master
Route::get('/kategori', [KategoriController::class,'index'])->name('kategori.index');
    Route::post('/tambah-kategori',[KategoriController::class,'store'])->name('kategori.create');
    Route::get('/edit-kategori',[KategoriController::class,'edit'])->name('kategori.edit');
    Route::put('/update-kategori/{id}',[KategoriController::class,'update'])->name('kategori.update');
    Route::get('/hapus-kategori/{id}',[KategoriController::class,'destroy'])->name('kategori.delete');

Route::get('/agenda', [AgendaController::class,'index'])->name('user.agenda');
Route::get('/agenda/surat-masuk', [AgendaController::class,'surat_masuk']);
Route::get('/tambah-agenda', [AgendaController::class,'create'])->name('user.tambah-agenda');
Route::post('/simpan-agenda', [AgendaController::class,'store'])->name('user.simpan-agenda');
Route::get('/kategori-dokumen', [KategoriDokumenController::class,'index'])->name('kategoridoc.index');
    Route::post('/tambah-kategori-dokumen',[KategoriDokumenController::class,'store'])->name('kategoridoc.create');
    Route::get('/edit-kategori-dokumen',[KategoriDokumenController::class,'edit'])->name('kategoridoc.edit');
    Route::put('/update-kategori-dokumen/{id}',[KategoriDokumenController::class,'update'])->name('kategoridoc.update');
    Route::get('/hapus-kategori-dokumen/{id}',[KategoriDokumenController::class,'destroy'])->name('kategoridoc.delete');

Route::get('/role', [RoleController::class,'index'])->name('role.index');
    Route::post('/tambah-role',[RoleController::class,'store'])->name('role.create');
    Route::get('/edit-role',[RoleController::class,'edit'])->name('role.edit');
    Route::put('/update-role/{id}',[RoleController::class,'update'])->name('role.update');
    Route::get('/hapus-role/{id}',[RoleController::class,'destroy'])->name('role.delete');
