<?php

use App\Http\Controllers\Install\InstallController;
use Illuminate\Support\Facades\Route;

Route::prefix('install')->name('install.')->group(function () {
    Route::middleware('not.installed')->group(function () {
        Route::get('/', [InstallController::class, 'welcome'])->name('welcome');
        Route::get('/requirements', [InstallController::class, 'requirements'])->name('requirements');
        Route::get('/database', [InstallController::class, 'database'])->name('database');
        Route::post('/database', [InstallController::class, 'testDatabase'])->name('database.test');
        Route::get('/application', [InstallController::class, 'application'])->name('application');
        Route::post('/application', [InstallController::class, 'storeApplication'])->name('application.store');
        Route::get('/admin', [InstallController::class, 'admin'])->name('admin');
        Route::post('/install', [InstallController::class, 'install'])->name('run')->middleware('throttle:5,1');
    });
    Route::get('/complete', [InstallController::class, 'complete'])->name('complete');
});
