<?php

use Illuminate\Support\Facades\Route;

use App\Http\Controllers\superadmin\SuperadminController;
use App\Http\Controllers\superadmin\adminuser\AdminuserController;
use App\Http\Controllers\superadmin\adminuser\ChangePasswordController;

/*
|--------------------------------------------------------------------------
| 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::prefix('superadmin')->name('superadmin.')->group(function(){
Route::get('login',[SuperadminController::class,'login'])->name('login');
Route::get('index',[SuperadminController::class,'index'])->name('index');
Route::post('login_process',[SuperadminController::class,'login_process']);



//adminotp
Route::get('adminotp/{token}',[SuperadminController::class,'adminotp'])->name('adminotp');
Route::post('adminotpverifyupdate',[SuperadminController::class,'adminotpverifyupdate'])->name('adminotpverifyupdate'); 
Route::get('adminresendotp/{token}',[SuperadminController::class,'adminresendotp'])->name('adminresendotp');
Route::get('logout',[SuperadminController::class,'logout'])->name('logout');

//forgotpassword
Route::get('forgotpassword',[SuperadminController::class,'forgotpassword'])->name('forgotpassword');
Route::post('forchangepassword',[SuperadminController::class,'forchangepassword'])->name('forchangepassword');
Route::post('updatechangepassword',[SuperadminController::class,'updatechangepassword'])->name('updatechangepassword');
Route::get('updatepassword/{token}',[SuperadminController::class,'updatepassword'])->name('updatepassword');


//admin user
Route::get('adminuser',[AdminuserController::class,'adminuser'])->name('adminuser');
Route::get('adminuseradd',[AdminuserController::class,'adminuseradd'])->name('adminuseradd');
Route::get('adminuserdelete/{id}',[AdminuserController::class,'adminuserdelete'])->name('adminuserdelete');
Route::post('adminusercreate',[AdminuserController::class,'adminusercreate'])->name('adminusercreate');
Route::post('houseajexadminuser',[AdminuserController::class,'houseajexadminuser'])->name('houseajexadminuser');
Route::post('adminuserstatus',[AdminuserController::class,'adminuserstatus'])->name('adminuserstatus');
Route::get('adminuseredit/{id}',[AdminuserController::class,'adminuseredit'])->name('adminuseredit');
Route::post('adminuserupdate/{id}',[AdminuserController::class,'adminuserupdate'])->name('adminuserupdate');
Route::get('permission_denied',[AdminuserController::class,'permission_denied'])->name('permission_denied');

Route::get('role',[AdminuserController::class,'role'])->name('role');
Route::post('rolecreate',[AdminuserController::class,'rolecreate'])->name('rolecreate');
Route::post('roleedit',[AdminuserController::class,'roleedit'])->name('roleedit');
Route::post('rolestatus',[AdminuserController::class,'rolestatus'])->name('rolestatus');
Route::post('roleajax',[AdminuserController::class,'roleajax'])->name('roleajax');
Route::get('roledelete/{id}',[AdminuserController::class,'roledelete'])->name('roledelete');



//change password

Route::get('changepassword/{id}', [ChangePasswordController::class, 'changepassword'])->name('changepassword');
Route::post('passwordupdate', [ChangePasswordController::class, 'passwordupdate'])->name('passwordupdate');


});



/// Route::get('/login', [SuperadminController::class, 'login']);
/// Route::get('/index', [SuperadminController::class, 'index']);

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

Route::get('/', function () {
    return view('welcome');
});
