<?php

use App\Http\Controllers\AuthController;
use Illuminate\Support\Facades\Route;

Route::get('/', [AuthController::class, 'index'])->name('root');
Route::get('admin', [AuthController::class, 'index'])->name('admin');

Route::prefix('admin')->name('admin.')->middleware('guest')->group(function () {
    Route::get('login', [AuthController::class, 'index'])->name('login');
    Route::post('login', [AuthController::class, 'adminLogin'])->name('login');
});

Route::prefix('admin')->name('admin.')->middleware('auth')->group(function () {
    Route::view('dashboard', 'admin.dashboard')->name('dashboard');
    Route::get('settings', [])->name('settings');
    Route::post('logout', [AuthController::class, 'adminLogout'])->name('logout');

    Route::prefix('country')->name('country.')->group(function () {
        Route::get('index', [])->name('index');
        Route::get('create', [])->name('create');
        Route::get('edit', [])->name('edit');
        Route::delete('delete', [])->name('delete');
    });

    Route::prefix('server')->name('server.')->group(function () {
        Route::get('index', [])->name('index');
        Route::get('create', [])->name('create');
        Route::get('edit', [])->name('edit');
        Route::delete('delete', [])->name('delete');
    });

    Route::prefix('package')->name('package.')->group(function () {
        Route::get('index', [])->name('index');
        Route::get('create', [])->name('create');
        Route::get('edit', [])->name('edit');
        Route::delete('delete', [])->name('delete');
    });

    Route::prefix('user')->name('user.')->group(function () {
        Route::get('index', [])->name('index');
        Route::get('create', [])->name('create');
        Route::get('edit', [])->name('edit');
        Route::delete('delete', [])->name('delete');
    });

    Route::prefix('notification')->name('notification.')->group(function () {
        Route::get('index', [])->name('index');
        Route::get('create', [])->name('create');
    });
});
