<?php

use Illuminate\Support\Facades\Route;
use App\Http\Controllers\GeneratorController;
use Illuminate\Http\Request;

// We will use a custom middleware class instead of a closure
Route::middleware([\App\Http\Middleware\StaticBasicAuth::class])->group(function () {
    Route::get('/', [GeneratorController::class, 'index'])->name('generator.index');
    Route::post('/generate', [GeneratorController::class, 'generate'])->name('generator.generate');
    Route::get('/result/{batch}', [GeneratorController::class, 'result'])->name('generator.result');
});

Route::get('/download/{peserta}', [GeneratorController::class, 'download'])->name('generator.download');
