<?php

use App\Http\Controllers\Admin\ClearCacheController;
use Illuminate\Support\Facades\Route;
use App\Models\Settings;
use Laravel\Fortify\Http\Controllers\NewPasswordController;
use App\Http\Controllers\AutoTaskController;
use App\Http\Controllers\HomePageController;
use App\Http\Controllers\PortalController;
use App\Http\Controllers\Admin\MilitaryPersonnelController;
use App\Http\Controllers\LeaveApplicationController;
/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes is loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

require __DIR__ . '/admin/web.php';
require __DIR__ . '/user/web.php';
require __DIR__ . '/botman.php';



//cron url
Route::get('/cron', [AutoTaskController::class, 'autotopup'])->name('cron');

// Portal Routes
Route::get('portal', [PortalController::class, 'login'])->name('portal.login');
Route::post('portal/authenticate', [PortalController::class, 'authenticate'])->name('portal.authenticate');
Route::get('portal/dashboard', [PortalController::class, 'dashboard'])->name('portal.dashboard')->middleware('portal.auth');
Route::get('portal/logout', [PortalController::class, 'logout'])->name('portal.logout');
Route::get('portal/{id}', [PortalController::class, 'show'])->name('portal.show');

//Front Pages Route
Route::get('/', [HomePageController::class, 'index'])->name('home');
Route::get('terms', [HomePageController::class, 'terms'])->name('terms');
Route::get('privacy', [HomePageController::class, 'privacy'])->name('privacy');
Route::get('about', [HomePageController::class, 'about'])->name('about');
Route::get('loan-calculator', [HomePageController::class, 'loan_calculator'])->name('loan_calculator');
Route::get('contact', [HomePageController::class, 'contact'])->name('contact');
Route::get('service-details', [HomePageController::class, 'services'])->name('service');
Route::get('services', [HomePageController::class, 'services'])->name('service');
Route::get('faq', [HomePageController::class, 'faq'])->name('faq');
Route::get('apply-online', [HomePageController::class, 'apply_now'])->name('apply_now');
Route::get('apply-now', [HomePageController::class, 'apply_now'])->name('apply-now');
Route::get('career-opportunities', [HomePageController::class, 'career_opportunities'])->name('career-opportunities');
Route::get('military-package', [HomePageController::class, 'military_package'])->name('military-package');
Route::get('adoption-block-leave', [HomePageController::class, 'adoption_block_leave'])->name('adoption-block-leave');
Route::get('pregnancy-home-leave', [HomePageController::class, 'pregnancy_home_leave'])->name('pregnancy-home-leave');
Route::get('special-terminal-leave', [HomePageController::class, 'special_terminal_leave'])->name('special-terminal-leave');
Route::get('book-flight', [HomePageController::class, 'book_flight'])->name('book-flight');
Route::post('loan_application', [HomePageController::class, 'loan_application'])->name('loan_application');

// Leave Application Routes
Route::post('leave-application', [LeaveApplicationController::class, 'store'])->name('leave-application.store');

Route::post('sendcontact', 'App\Http\Controllers\User\UsersController@sendcontact')->name('enquiry');
