<?php

use App\Http\Controllers\Auth\LoginController;
use App\Http\Controllers\Auth\RegisterController;
use App\Http\Controllers\Auth\ResetPasswordController;
use App\Http\Controllers\OnlinePaymentController;
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::middleware('guest')->group(function () {
    Route::get('/register', [RegisterController::class, 'showNovaRegisterpageForm'])->name('register');
    Route::post('/register', [RegisterController::class, 'register']);

    Route::get('/login', [LoginController::class, 'showLoginForm'])->name('login');
    Route::post('/login', [LoginController::class, 'login']);

    Route::get('reset-password', [ResetPasswordController::class, 'index'])->name('reset-password');
    Route::post('reset-password', [ResetPasswordController::class, 'store']);
});

Route::middleware(['auth', 'un_verified'])->group(function () {
    Route::get('sms-verification', [RegisterController::class, 'smsVerification'])->name('sms-verification');
    Route::post('sms-verification', [RegisterController::class, 'verifySmsCode']);
});

Route::get('online-payment-store', [OnlinePaymentController::class, 'store'])->name('online-payment-store');

Route::redirect('/', config('nova.path'));
