<?php

use Illuminate\Support\Facades\Route;
// use App\Http\Controllers\AdminController;
// Route::get('/', function () {
//     return view('welcome');
// });
use App\Mail\NewClientMail;

Auth::routes([
	'register' => false, // Disables the registration routes
    'reset'    => false, // Disables the password reset routes
    'verify'   => false, // Disables the email verification routes
]);

Route::get('/send-test-email', function () {
    $recipientEmail = 'recipient@example.com';
    Mail::to($recipientEmail)->send(new NewClientMail($recipientEmail));
    dd('Email sent!');
});



Route::get('/client-login', [App\Http\Controllers\ClientsLoginController::class, 'index']);
Route::post('/client-login', [App\Http\Controllers\ClientsLoginController::class, 'handleLogin']);
Route::get('/client-logout', [App\Http\Controllers\ClientsLoginController::class, 'handle_logout'])->name('user-logout');
Route::get('/client-reset', [App\Http\Controllers\ClientsLoginController::class, 'reset']); // shows form for user enter reset email
Route::post('/client-reset', [App\Http\Controllers\ClientsLoginController::class, 'check_reset_email']); // checks email and calls show new pass form

Route::get('/reset-auth/{id}', [App\Http\Controllers\ClientsLoginController::class, 'show_new_passform']); // checks email and calls show new pass form

Route::get('/new-password-form', [App\Http\Controllers\ClientsLoginController::class, 'show_new_passform']); // handles pass change and shows success
Route::get('/reset-notice', [App\Http\Controllers\ClientsLoginController::class, 'reset_notice']);
Route::post('/passowrd-reset', [App\Http\Controllers\ClientsLoginController::class, 'handle_reset']);
Route::get('/reset-success', [App\Http\Controllers\ClientsLoginController::class, 'reset_success']);

Route::get('/client-activation/{activation_hash}', [App\Http\Controllers\ClientsLoginController::class, 'activation_show']);
Route::post('/client-activation', [App\Http\Controllers\ClientsLoginController::class, 'activation']);


// Route::middleware([Authenticate::class])->group(function () {
	Route::middleware(['auth'])->group(function () {

		Route::get('/admin/home', [App\Http\Controllers\AdminController::class, 'index']);
		Route::get('/admin', [App\Http\Controllers\AdminController::class, 'index']);
		Route::get('admin/clients', [App\Http\Controllers\AdminController::class, 'index']);
		Route::get('admin/create', [App\Http\Controllers\AdminController::class, 'create'])->name('admin.create');
		Route::post('admin/clientstore', [App\Http\Controllers\AdminController::class, 'store'])->name('admin.clientstore');

		#Route::resource('posts', AdminController::class);
	});
	Route::middleware(['checksession', 'checkrole:administrator'])->group(function () {
		Route::get('/', [App\Http\Controllers\ClientsTrafficController::class, 'index']);
		Route::get('client-traffic', [App\Http\Controllers\ClientsTrafficController::class, 'index']);
		Route::get('client-traffic-tabulator', [App\Http\Controllers\ClientsTrafficController::class, 'indexTabulator']);

		Route::get('send-sms', [App\Http\Controllers\ClientsTrafficController::class, 'smsForm']);
		Route::get('client-apps', [App\Http\Controllers\ClientsTrafficController::class, 'getClientApps']);

		Route::post('send-sms', [App\Http\Controllers\ClientsTrafficController::class, 'store'])->name('client.sendsms');
		Route::post('client-newapp', [App\Http\Controllers\ClientsTrafficController::class, 'newAppStore'])->name('client.sendsms');
		
		Route::post('client-dailysmsunits', [App\Http\Controllers\ClientsTrafficController::class, 'dailySmsUnits'])->name('client.dailysmsunits');
		


		Route::get('/client-users', [App\Http\Controllers\ClientUsersController::class, 'index']);
		Route::get('/fetch-client-users', [App\Http\Controllers\ClientUsersController::class, 'fetch']);
		Route::post('/client-users', [App\Http\Controllers\ClientUsersController::class, 'store']);
		Route::get('/client-users/{id}/edit', [App\Http\Controllers\ClientUsersController::class, 'edit']);
		Route::put('/client-users/{id}', [App\Http\Controllers\ClientUsersController::class, 'update']);
		Route::delete('/client-users/{id}', [App\Http\Controllers\ClientUsersController::class, 'destroy']);

		// Route::post('send-sms', [App\Http\Controllers\ClientsTrafficController::class, 'store'])->name('client.sendsms');

	});
// Route::get('project-status/add_status/{id}', [App\Http\Controllers\ProjectStatusesController::class, 'add_status'])->name('add_status');


// Route::get('/project-status', [App\Http\Controllers\ProjectStatusesController::class, 'index']);
// Route::resource('project-status', App\Http\Controllers\ProjectStatusesController::class);

// Route::resource('projects', App\Http\Controllers\ProjectsController::class);
// Route::resource('comments', App\Http\Controllers\CommentsController::class);

// Route::get('comments/add_comment/{id}', [App\Http\Controllers\CommentsController::class, 'add_comment']);

// Route::resource('', [App\Http\Controllers\::class]);
// Route::get('/project-status/create', [App\Http\Controllers\ProjectStatusesController::class, 'create']);

// Route::get('/project-status/edit', [App\Http\Controllers\ProjectStatusesController::class, 'create']);

// Route::get('/projects', [App\Http\Controllers\ProjectsController::class, 'index']);
