<?php

use Illuminate\Support\Facades\Route;
use App\Http\Controllers\Admin\Auth\AdminAuthController;

Route::middleware('guest:admin')->group(function () {
    Route::get('/login', [AdminAuthController::class, 'create'])
        ->name('admin.login');

    Route::post('/login', [AdminAuthController::class, 'store'])
        ->name('admin.login.store');
});

Route::middleware('auth:admin')->group(function () {
    Route::get('/', function () {
        return view('admin.home');
    })->name('admin.home');

    Route::post('/logout', [AdminAuthController::class, 'destroy'])
        ->name('admin.logout');
});

Route::fallback(fn () => abort(404));
