<?php

use Illuminate\Support\Facades\Route;
use App\Http\Controllers\Admin\AdminController;

Route::middleware(['auth', 'force_change_password', 'admin'])->prefix('admin')->name('admin.')->group(function () {
    Route::get('/', [AdminController::class, 'index'])->name('dashboard');
    Route::get('/users', [AdminController::class, 'index'])->name('users.index');
    
    Route::get('/users/create', [AdminController::class, 'create'])->name('users.create');
    Route::post('/users', [AdminController::class, 'store'])->name('users.store');
    Route::get('/users/{msnv}/edit', [AdminController::class, 'edit'])->name('users.edit');
    Route::put('/users/{msnv}', [AdminController::class, 'update'])->name('users.update');
    Route::delete('/users/{msnv}', [AdminController::class, 'destroy'])->name('users.destroy');
    
    Route::put('/add-cards/{id}', [AdminController::class, 'updateAddCard'])->name('add_cards.update');
    Route::delete('/add-cards/{id}', [AdminController::class, 'destroyAddCard'])->name('add_cards.destroy');
});
