<?php

use App\Http\Controllers\Admin\Auth\LoginController;
use App\Http\Controllers\Admin\KategoriController;
use App\Http\Controllers\TransaksiController;
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 and all of them will
| be assigned to the "web" middleware group. Make something great!
|
*/

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

Route::get('/transaksi', [TransaksiController::class, 'index'])->name('admin.index-transaksi');

Route::middleware(['auth','prevent-back-history'])->group(function(){
    Route::get('/home', function () {
        return view('dashboard');
    });
    Route::resource('kategori', KategoriController::class);
    Route::get('/logout', [LoginController::class, 'logout'])->name('admin.logout');
});
