<?php

use Illuminate\Support\Facades\Route;
use App\Http\Middleware\Session;
use App\Http\Controllers\HomeController;
use App\Http\Controllers\Management\UserController;
use App\Http\Controllers\Management\RoleController;
use App\Http\Controllers\Management\AksesController;


Route::get('dashboard',[HomeController::class,'dashboard'])->name('dashboard');

Route::name('management.')->prefix('management')->group(function () {
    Route::name('user.')->prefix('user')->group(function () {
        Route::resource('/',UserController::class);
        Route::get('grid',[UserController::class,'grid'])->name('grid');
        Route::get('update/{id?}',[UserController::class,'update'])->name('update');
        Route::get('delete/{id?}',[UserController::class,'delete'])->name('delete');
        Route::get('forcelogin/{id?}',[UserController::class,'forcelogin'])->name('forcelogin');
    });

    Route::name('role.')->prefix('role')->group(function () {
        Route::resource('/',RoleController::class);
        Route::get('grid',[RoleController::class,'grid'])->name('grid');

        Route::name('akses.')->prefix('akses')->group(function () {
            Route::resource('/',AksesController::class);
            Route::get('{id}/edit',[AksesController::class,'edit'])->name('edit');
        });
    }); 
});