<?php

use Illuminate\Support\Facades\DB;
use Spatie\Permission\Models\Permission;
use Spatie\Permission\Models\Role;
use Illuminate\Support\Facades\Route as AmirRoute;
use Illuminate\Support\Facades\Hash;
use App\Models\User;
use Carbon\Carbon;
use Hekmatinasser\Verta\Verta;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use App\Http\Controllers\Api\ForgotPasswordController;
use App\Models\TarhList;
use App\Models\Contracts;


// use SoapFault;
// use SoapClient;

Route::middleware('auth')->group(function () {
    // these route can pass without check user confirm condition
    Route::prefix('valid')->group(function () {
        Route::get('loginkarbar', function () {
            if (!Auth::user()->confirmed) {
                return view('rmto-preview.pages.loginkarbar');
            }
            return redirect(route('v2.dashboard'));
        });

        Route::post('submitinfo', 'UserController@storeInformation');

        Route::get('submitinfo/myData', 'UserController@getMyData');
    });
});


// Route::get('rahdari_projects/project/{id}', function () {
//     return view('version2.dashboard_pages.rahdari_projects.project_without_login');
// });


// // Route::get('/correct_data', 'DevelopController@correct_data');
// Route::get('/test_log', 'DevelopController@test_log');
// Route::get('/avatar', 'DevelopController@test_log');
// Route::get('/miladdeveloproute', 'DevelopController@func1');
// Route::get('/milad/test', 'DevelopController@Develop');

// Route::get('technotransport2022', function () {
//     return view('rmto-preview.pages.techno2022');
// });

// Route::post('technotransport2022', 'TechnoTransportController@addTechnoTransport');

// /// project list begin

// Route::get('/bama/{id}', function () {
//     return view('rmto-preview.pages.bama-single');
// })->middleware(['auth', 'confirmUser']);

// Route::get('bama/show', 'BamaController@show');
Route::get('bama-index', 'BamaController@showList');
Route::get('/bama-index/{id}', 'BamaController@getSingleData');

// Route::get('/bama', 'BamaController@index')->middleware(['auth', 'confirmUser']);
Route::get('/public/bama-homepage', 'BamaController@homepage_report');
// /// project list end

Route::get('poster/progress_info', 'PostersController@progressInfo');
// Route::get('poster/progress_info2', 'PostersController@progressInfo');
// Route::get('poster/progress_info3', 'PostersController@progressInfo');
// Route::get('poster/progress_info_develop', 'PostersController@progressInfodevelop');

// /// UserActivity begin
// Route::get('webapi/activity/road-item-project-report', 'UserActivityController@roadItemProjectReport');

// Route::get('/user-activity-report/static-print-country-chart', 'UserActivityController@staticPrintCountryChart');
Route::get('/user-activity-report/static-print-organization-chart', 'UserActivityController@staticPrintOrganizationChart');

Route::post('/user-activity-report/add', 'UserActivityController@addGroup');
Route::post('/user-activity-report/edit/{role}', 'UserActivityController@editGroup');
Route::post('/user-activity-report/delete/{role}', 'UserActivityController@deleteGroup');
Route::get('/user-activity-report/print/{role}', 'UserActivityController@printGroup');
Route::get('/user-activity-report-index', 'UserActivityController@indexShow')->middleware(['auth', 'confirmUser']);
Route::get('/user-activity-report/show-users/{role}', 'UserActivityController@showUsers');
Route::get('/user-activity-report/log-list', 'UserActivityController@logList');
// // Route::get('/user-activity-report/{role}', 'UserActivityController@userLogs');
// // https://rms.rmto.ir/user-activity-report/show/56
// Route::get('/user-activity-report', 'UserActivityController@index')->middleware(['auth']);

// Route::get('users/user-activity-logs', 'UserController@userActivityLogs');
// /// UserActivity end


// Route::middleware('cors:api')->get('/public/rahdari/road-maintenance-project/{id}/get-distance', 'RoadMaintenanceProjectPublicController@getMaintenanceProjectDistancePublic');
// Route::middleware('cors:api')->get('/public/rahdari/road-maintenance-project/{id}/get-distance-update-list', 'RoadMaintenanceProjectPublicController@getMaintenanceProjectDistanceUpdateListPublic');
// Route::middleware('cors:api')->get('/public/cmms-data', 'CmmsDemoController@index');
// Route::middleware('cors:api')->get('/public/cmms', 'CmmsDemoController@index_view');
// Route::middleware('cors:api')->get('/public/cmms-download', 'CmmsDemoController@download');
// Route::middleware('cors:api')->get('/public/rahdari/road-danger-prevention/getlist', 'RoadDangerPreventionPublicController@getDangerPreventionListPublic');
// Route::middleware('cors:api')->get('/public/rahdari/road-danger-prevention/{id}/get-distance-update-list', 'RoadDangerPreventionPublicController@getDangerPreventionDistanceUpdateList');
// Route::middleware('cors:api')->get('/public/rahdari/road-upgrade-safety/getlist', 'RoadUpgradeSafetyPublicController@getUpgradeSafetyListPublic');
// Route::middleware('cors:api')->get('/yasitestmap', function () {
//     switch (request()->type) {
//         case 'camp':
//             if (auth()->user()) {
//                 auth()->user()->addActivityComplete(1051);
//             }
//             break;

//         case 'campNew':
//             if (auth()->user()) {
//                 auth()->user()->addActivityComplete(1115);
//             }
//             break;

//         case 'fastreact':
//             if (auth()->user()) {
//                 auth()->user()->addActivityComplete(1114);
//             }
//             break;

//         case 'rahdari':
//             if (auth()->user()) {
//                 auth()->user()->addActivityComplete(1030);
//             }
//             break;

//         case 'pro':
//             if (auth()->user()) {
//                 auth()->user()->addActivityComplete(1013);
//             }
//             break;

//         case 'rahdar':
//             if (auth()->user()) {
//                 auth()->user()->addActivityComplete(1023);
//             }
//             break;
//     }
//     return view('rmto-preview.pages.yasitestmap');
// });

// // Route::get('/', function () {
// //     return view('rmto-preview.pages.new_template');
// // })->middleware(['auth', 'confirmUser', 'randd']);

// Route::get('/', function () {
//     return view('rmto-preview.pages.new_template');
// })->middleware(['auth', 'confirmUser', 'randd']);


Auth::routes();

// Route::get('/clear-cache-clear-cache', function () {
//     Artisan::call('cache:clear');
//     Artisan::call('route:clear');
//     Artisan::call('view:clear');
//     Artisan::call('config:clear');
//     Artisan::call('event:clear');
//     Artisan::call('optimize:clear');
//     Artisan::call('clear-compiled');
//     return "Cache is cleared";
// });

// // Route::get('/home', function () {
// //     return redirect('rmto');
// // })->name('home');


Route::get('rmtologin', function () {
    return redirect('login');
})->name('rmtologin');

// Route::post('road-items-amir', 'RoadItemsProjectController@store');

// Route::middleware(['auth'])->group(function () {
//     Route::get('rmto', function () {
//         return redirect('/');
//     });


//     /* cmms's view */
Route::get('cmms-audit', function () {
    return view('cmms.audit_index');
}); // view
Route::get('cmms-audit/add', function () {
    return view('cmms.audit_create');
}); // view

Route::get('cmms-audit/{id}/edit', function (Illuminate\Http\Request $request) {
    $id = $request->id;

    return view('cmms.audit_update', compact('id'));
}); // view

Route::get('cmms/all', 'Api\CMMSController@index'); // api
//     Route::post('cmms/create', 'Api\CMMSController@store'); // api
//     Route::get('cmms/provinces/all', 'Api\CMMSController@getProvinces'); // api
Route::post('cmms/{id}/edit', 'Api\CMMSController@update'); // api


//     Route::resource('road-items', 'RoadItemsProjectController')->except([
//         'show', 'edit', 'update', 'destroy'
//     ]);

//     Route::resource('road-construction', 'RoadConstructionProjectController')->except([
//         'show', 'update', 'destroy'
//     ]);

Route::get('bi/subtitleCounts', 'Api\BiController@getSubtitleCounts');

//     Route::view('rmtobi', 'rmto-preview.BI');
//     Route::get('project_list', 'RoadConstructionProjectController@index');
//     Route::view('rmto-patrol', 'rmto-preview.pages.road-patrol');
//     Route::post('rmto-patrol-add', 'RoadPatrolProjectController@store');
//     Route::get('accident-251-points', 'Accident251PointController@index');
//     Route::get('accident-251-points-dt', 'Accident251PointController@datatable');
//     Route::post('accident-251-points/{point}', 'Accident251PointController@update');
//     Route::get('accident-points', 'AccidentPointController@index');
//     Route::get('accident-points-dt', 'AccidentPointController@datatable');
//     Route::post('accident-points/{point}', 'AccidentPointController@update');
//     Route::get('abrar-projects', 'AbrarPlanProjectController@index');
//     Route::get('abrar-projects/{project}', 'AbrarPlanProjectController@show');
//     Route::post('abrar-projects/{project}', 'AbrarPlanProjectController@update');


Route::get('webapi/users', 'UserController@index');
//     Route::get('usersn', 'UserController@getUserListPage');
//     Route::post('users/reset/{id}', 'UserController@updateToDefaultPassword');
//     Route::post('users', 'UserController@store');
Route::post('users/change_password/{user}', 'UserController@changePassword');
Route::get('users/summary_report/{user}', 'UserController@getUserSummaryReport');

//     //Route::get('users/projects', 'UserController@getUserProjects');
//     Route::get('users/projects', 'UserController@getNewUserProjects');
//     Route::get('users/get_user_permissions_types', 'UserController@getUserPermissionsTypes');
Route::post('users/change_confirmed_status', 'UserController@changeConfirmedStatus');
Route::get('users/change_user_enabeld/{user}', 'UserController@changeUserEnabeld');
Route::post('users/give_permissions', 'UserController@givePermissionsTo');
Route::post('users/delete', 'UserController@destroy');
//     Route::post('users/{id}', 'UserController@update');
//     // Route::get('users/rate', 'UserController@getUserRating');

//     Route::get('users/cities-projects-count', 'UserController@getProvinceProjectsCount');
//     Route::get('users/cities-projects-item', 'UserController@getProvinceProjectsItem');
//     Route::post('users/cities-projects-item/delete', 'UserController@deleteSpecificUserProject');
//     Route::get('users/provinces-projects-count', 'UserController@getAdminProvinceProjectsCount');
//     Route::get('users/province-cities-projects-count', 'UserController@getAdminCityProjectsCount');
//     Route::get('users/list', 'UserController@getProfileAndUserList');
//     Route::post('users/updateinfo/{id}', 'UserController@updateUserInfo');
//     Route::get('projects/ristat', 'UserController@getRoadItemsProjectsStat');
//     Route::get('projects/getrirpadmin/{id}', 'UserController@getAdminProvinceProjectsItem');

//     Route::get('public/users/provinces-projects-count', 'UserController@getAdminProvinceProjectsCount');
//     Route::get('public/users/province-cities-projects-count', 'UserController@getAdminCityProjectsCount');
//     Route::get('public/projects/ristat', 'UserController@getRoadItemsProjectsStat');
//     Route::get('public/projects/getrirpadmin/{id}', 'UserController@getAdminProvinceProjectsItem');

Route::get('/karbarlist_old', 'View\UserController@showKarbarlist')->middleware(['auth', 'confirmUser'])->name('show.usermanagement');


//     // Route::get('/profile-getinfo', 'UserController@profile');
Route::post('/profile/edit', 'UserController@profile_edit');

Route::get('users/{id}/permission/', 'UserController@userPermission');
Route::post('users/{user}/permission/', 'UserController@assignPermission');
Route::middleware('auth')->resource('users', 'UserController');
Route::get('webapi/user/get-permission', 'UserController@getUserPermissions')->middleware(['auth']);
Route::post('add-simple-users', 'UserController@simpleAddUser');
//     Route::post('edit-role/{id}', 'UserController@editRole');
Route::post('create-role', 'UserController@createRole');
//     Route::post('delete-role/{id}', 'UserController@deleteRole');

Route::get('user/permissions', 'UserController@getAllPermissions');



//     Route::get('users/{id}/permission/', 'UserController@userPermission');
//     Route::post('users/{user}/permission/', 'UserController@assignPermission');
//     Route::get('user/status/{id}', 'UserController@status');
//     Route::post('create-role', 'UserController@createRole');
Route::get('show-all-roles', 'UserController@showAllRoles');
Route::get('show-role/{id}', 'UserController@showRole');
Route::post('edit-role/{id}', 'UserController@editRole');
Route::post('delete-role/{id}', 'UserController@deleteRole');

Route::get('/user-activity-report/print/user/{user}', 'UserController@printGroup');


//     Route::get('events', 'RmsEventController@index');
//     Route::post('events', 'RmsEventController@storeEvent');
//     Route::get('events/user/download/{id}', 'RmsEventController@userDownloadEvent');
//     Route::post('events/user/upload/{id}', 'RmsEventController@userUploadEvent');
//     Route::get('events/create', 'RmsEventController@create');
//     Route::get('events/list', 'RmsEventController@userEventList');
//     Route::get('events/histories/{id}', 'RmsEventController@getEventHistories');
//     Route::get('events/edit/{id}', 'RmsEventController@edit');
//     Route::post('events/edit/{id}', 'RmsEventController@update');
//     Route::post('events/delete/{id}', 'RmsEventController@destroy');
//     Route::get('projects/road-items/{id}/edit', 'RoadItemsProjectController@edit');
//     Route::get('projects/road-items/{id}', 'RoadItemsProjectController@show');
//     Route::post('projects/road-items/{id}', 'RoadItemsProjectController@update');
//     Route::post('events/archive/{id}', 'RmsEventController@archiveEvent');
//     Route::get('events/archive', 'RmsEventController@indexArchivedEvent');
//     Route::get('events/archived', 'RmsEventController@getArchivedEventPage');
//     Route::get('projects/road-items-view/{id}', 'RoadItemsProjectController@viewProject');
//     Route::get('projects/riview', 'RoadItemsProjectController@viewProjectPage');
//     Route::get('projects/getrirpadmin', 'RoadItemsProjectController@table3InRoadItemProject');
//     Route::get('/jahesh-project', 'JaheshOperationController@index');
//     Route::post('/jahesh-project/{id}', 'JaheshOperationController@update');
//     Route::get('/jahesh-project/edit', 'JaheshOperationController@showJaheshEditForm');
//     Route::get('/homeprojects/roaditems/points', 'HomeProjectController@getRoadItemsProjectPoints');
//     Route::get('/contents/provinces/{?flag}', 'HomeContentController@getAllProvinces');
//     Route::get('/contents/provinces/{id}', 'HomeContentController@getAllCitiesByProvince');
//     Route::get('/road-maintenance-project/getlist', 'RoadMaintenanceProjectController@index');
//     // Route::get('/road-maintenance-project/create', 'RoadMaintenanceProjectController@create');
//     Route::post('/road-maintenance-project', 'RoadMaintenanceProjectController@store');
//     Route::post('/road-maintenance-project/{id}/edit', 'RoadMaintenanceProjectController@update');
//     Route::get('/road-maintenance-project/show/{id}', 'RoadMaintenanceProjectController@show');
//     Route::get('/road-maintenance-project/getpoints', 'RoadMaintenanceProjectController@indexPoints');
//     Route::get('/road-maintenance-project/getstatuslist', 'RoadMaintenanceProjectController@indexStatus');
//     Route::post('/road-maintenance-project/{id}/edit-status', 'RoadMaintenanceProjectController@updateStatus');
//     Route::get('/road-maintenance-project/status', 'RoadMaintenanceProjectController@getLastStatus');
//     Route::get('/road-maintenance-project/create-new', 'RoadMaintenanceProjectController@createNew');


//     Route::get('/danger-point', 'DangerPointController@showDangerPointPage');
//     Route::get('/danger-point-admin', 'DangerPointController@showDangerPointAdminPage');

//     //Route::get('/danger-point-dnbauweoik930u42hkied', 'DangerPointController@addNewUsers');

//     Route::get('webapi/danger-point/get-user-provinces', 'DangerPointController@getUserProvince');

//     Route::post('webapi/danger-point/create', 'DangerPointController@storeDanger');
//     Route::post('webapi/danger-point/{id}/edit', 'DangerPointController@updateDanger');
//     Route::post('webapi/danger-point/details', 'DangerPointController@storeDangerDetails');
//     Route::post('webapi/danger-point/accident', 'DangerPointController@storeDangerAccident');
//     Route::post('webapi/danger-point/details/{id}/edit', 'DangerPointController@updateDangerDetails');
//     Route::post('webapi/danger-point/accident/{id}/edit', 'DangerPointController@updateDangerAccident');
//     Route::post('webapi/danger-point/images', 'DangerPointController@storeDangerImages');
//     Route::get('webapi/danger-point/getlist', 'DangerPointController@getDangerPoint');
//     Route::get('webapi/danger-point/getlist-admin', 'DangerPointController@getDangerPointAdmin');
//     Route::get('webapi/danger-point/{id}/getacclist', 'DangerPointController@getDangerAccidents');
//     Route::post('webapi/danger-point/images/upload', 'DangerPointController@storeDangerPreviewImage');
//     Route::post('webapi/danger-point/images/delete', 'DangerPointController@destroyDangerPreviewImage');
//     Route::get('webapi/danger-point/{id}/preview/{op}', 'DangerPointController@getDangerPointPreview');
//     Route::post('webapi/danger-point/images/files', 'DangerPointController@uploadDangerPointFiles');
//     Route::post('webapi/danger-point/images/files/delete', 'DangerPointController@destroyDangerFilesImage');
//     Route::post('webapi/danger-point/status/province-submit', 'DangerPointController@provinceFinalSubmit');
//     Route::post('webapi/danger-point/{id}/delete', 'DangerPointController@destroyDanger');
//     Route::post('webapi/danger-point/status/admin-submit', 'DangerPointController@adminSubmitStatus');
//     Route::post('webapi/danger-point/delete/acc', 'DangerPointPublicController@destroyDangerPointAccident');


//     // dayli accident begin
// Route::get('/daily_accident', 'View\DailyAccidentController@index');
Route::get('/daily_accident/show', 'DailyAccidentController@show');
Route::post('/daily_accident/store', 'DailyAccidentController@store');
Route::post('/daily_accident/update/{accident}', 'DailyAccidentController@update');
Route::post('/daily_accident/delete/{accident}', 'DailyAccidentController@delete');

//     Route::get('/daily_accident/get_pending_accidents_count', 'DailyAccidentController@getPendingAccidentsCount');
Route::get('/daily_accident/accident_reasons', 'DailyAccidentController@getAccidentReasons');
Route::get('/daily_accident/accident_increase_damage_reasons', 'DailyAccidentController@getAccidentIncreaseDamageReasons');
Route::get('/daily_accident/get_participants', 'DailyAccidentController@getParticipants');
Route::get('/daily_accident/accident_types', 'DailyAccidentController@getAccidentTypes');
Route::get('/daily_accident/get_accident_collision_type', 'DailyAccidentController@getAccidentCollisionType');

Route::get('/daily_accident/{accident}', 'DailyAccidentController@details');
Route::post('/daily_accident/set_state/{accident}', 'DailyAccidentController@setState');

Route::get('/daily_accident_poster', 'DailyAccidentController@poster');
//     Route::get('/daily_accident_poster_information', 'DailyAccidentController@getPosterInformation');

//     Route::get('/daily_accident_map', 'View\DailyAccidentController@map');
Route::get('/daily_accident_map/accidents', 'DailyAccidentController@getAccidents');

//     // dayli accident end

//     /// map
//     Route::get('/road-maintenance-project/showonmap', 'RoadMaintenanceProjectPublicController@showMaintenanceProjectMap');
//     Route::get('/road-construction-rural/showonmap', 'RoadConstructionRuralPublicController@showConstructionRuralMap');
//     Route::get('/road-technical-building/showonmap', 'RoadTechnicalBuildingPublicController@showTechnicalBuildingMap');
//     Route::get('/road-danger-prevention/showonmap', 'RoadDangerPreventionPublicController@showDangerPreventionMap');
//     Route::get('/road-upgrade-safety/showonmap', 'RoadUpgradeSafetyPublicController@showUpgradeSafetyMap');
//     Route::get('/road-tollhouse-management/showonmap', 'RoadTollhouseManagementPublicController@showTollhouseManagementMap');
//     /// report
//     Route::get('/road-maintenance-project/report', 'RoadMaintenanceProjectPublicController@getRoadMaintenanceReportPage');

//     Route::get('webapi/road-maintenance-project/getstat', 'RoadMaintenanceProjectController@getMaintenanceProjectProvinceStat');
//     /// view of porozhe ha
//     // Route::view('/road-maintenance-project', 'rmto-preview.pages.road-maintenance-project');
//     // Route::view('/road-tollhouse-management', 'rmto-preview.pages.road-tollhouse-management');
//     // Route::view('/road-upgrade-safety', 'rmto-preview.pages.road-upgrade-safety');
//     // Route::view('/road-danger-prevention', 'rmto-preview.pages.road-danger-prevention');
//     // Route::view('/road-construction-rural', 'rmto-preview.pages.road-construction-rural');
//     // Route::view('/road-technical-building', 'rmto-preview.pages.road-technical-building');

//     /////////  porozhe haye rahdari routes


//     Route::get('rahdari/road-maintenance-project/getlist', 'RoadMaintenanceProjectPublicController@getMaintenanceProjectList');
//     Route::get('rahdari/road-maintenance-project/{id}/getproject', 'RoadMaintenanceProjectPublicController@getMaintenanceProject');
//     Route::post('rahdari/road-maintenance-project/create', 'RoadMaintenanceProjectPublicController@storeMaintenanceProject');
//     Route::post('rahdari/road-maintenance-project/{id}/edit', 'RoadMaintenanceProjectPublicController@updateMaintenanceProject');
//     Route::get('rahdari/road-maintenance-project/{id}/get-distance', 'RoadMaintenanceProjectPublicController@getMaintenanceProjectDistance');
//     Route::post('rahdari/road-maintenance-project/{id}/edit-distance', 'RoadMaintenanceProjectPublicController@updateMaintenanceProjectDistance');
//     Route::post('rahdari/road-maintenance-project/{id}/submit-distance', 'RoadMaintenanceProjectPublicController@submitMaintenanceProjectDistance');
//     Route::post('rahdari/road-maintenance-project/{id}/submit', 'RoadMaintenanceProjectPublicController@submitMaintenanceProject');
//     Route::post('rahdari/road-maintenance-project/{id}/delete', 'RoadMaintenanceProjectPublicController@destroyMaintenanceProject');
//     Route::get('rahdari/road-maintenance-project/{id}/get-distance-update', 'RoadMaintenanceProjectPublicController@getMaintenanceProjectDistanceUpdate');
//     Route::post('rahdari/road-maintenance-project/{id}/edit-distance-update', 'RoadMaintenanceProjectPublicController@updateMaintenanceProjectDistanceUpdate');
//     Route::get('rahdari/road-maintenance-project/{id}/get-distance-update-list', 'RoadMaintenanceProjectPublicController@getMaintenanceProjectDistanceUpdateList');
//     Route::post('rahdari/road-maintenance-project/history-images/upload', 'RoadMaintenanceProjectPublicController@storeMaintenanceProjectHistoryImage');
//     Route::post('rahdari/road-maintenance-project/history-images/delete-image', 'RoadMaintenanceProjectPublicController@destroyMaintenanceProjectHistoryImage');
//     Route::get('rahdari/road-maintenance-project/getstat', 'RoadMaintenanceProjectPublicController@getMaintenanceProjectProvinceStat');
//     Route::get('rahdari/road-maintenance-project/getpoints', 'RoadMaintenanceProjectPublicController@indexPoints');
//     Route::post('rahdari/road-maintenance-project/{id}/submit-history', 'RoadMaintenanceProjectPublicController@submitMaintenanceProjectHistory');
//     Route::post('rahdari/road-maintenance-project/submit-rate', 'RoadMaintenanceProjectPublicController@submitRoadMaintenanceProjectRate');




//     ////// road construction rural
//     Route::get('rahdari/road-construction-rural/getlist', 'RoadConstructionRuralPublicController@getConstructionRuralList');
//     Route::get('rahdari/road-construction-rural/{id}/getproject', 'RoadConstructionRuralPublicController@getConstructionRural');
//     Route::post('rahdari/road-construction-rural/create', 'RoadConstructionRuralPublicController@storeConstructionRural');
//     Route::post('rahdari/road-construction-rural/{id}/edit', 'RoadConstructionRuralPublicController@updateConstructionRural');
//     Route::get('rahdari/road-construction-rural/{id}/get-distance', 'RoadConstructionRuralPublicController@getConstructionRuralDistance');
//     Route::post('rahdari/road-construction-rural/{id}/edit-distance', 'RoadConstructionRuralPublicController@updateConstructionRuralDistance');
//     Route::post('rahdari/road-construction-rural/{id}/submit-distance', 'RoadConstructionRuralPublicController@submitConstructionRuralDistance');
//     Route::post('rahdari/road-construction-rural/{id}/submit', 'RoadConstructionRuralPublicController@submitConstructionRural');
//     Route::post('rahdari/road-construction-rural/{id}/delete', 'RoadConstructionRuralPublicController@destroyConstructionRural');
//     Route::get('rahdari/road-construction-rural/{id}/get-distance-update', 'RoadConstructionRuralPublicController@getConstructionRuralDistanceUpdate');
//     Route::post('rahdari/road-construction-rural/{id}/edit-distance-update', 'RoadConstructionRuralPublicController@updateConstructionRuralDistanceUpdate');
//     Route::get('rahdari/road-construction-rural/{id}/get-distance-update-list', 'RoadConstructionRuralPublicController@getConstructionRuralDistanceUpdateList');
//     Route::post('rahdari/road-construction-rural/history-images/upload', 'RoadConstructionRuralPublicController@storeConstructionRuralHistoryImage');
//     Route::post('rahdari/road-construction-rural/history-images/delete-image', 'RoadConstructionRuralPublicController@destroyConstructionRuralHistoryImage');
//     Route::get('rahdari/road-construction-rural/getstat', 'RoadConstructionRuralPublicController@getConstructionRuralProvinceStat');
//     Route::get('rahdari/road-construction-rural/getpoints', 'RoadConstructionRuralPublicController@indexPoints');
//     Route::post('rahdari/road-construction-rural/{id}/submit-history', 'RoadConstructionRuralPublicController@submitConstructionRuralHistory');
//     Route::post('rahdari/road-construction-rural/submit-rate', 'RoadConstructionRuralPublicController@submitRoadConstructionRuralRate');

//     //// road technical building

//     Route::get('rahdari/road-technical-building/getlist', 'RoadTechnicalBuildingPublicController@getTechnicalBuildingList');
//     Route::get('rahdari/road-technical-building/{id}/getproject', 'RoadTechnicalBuildingPublicController@getTechnicalBuilding');
//     Route::get('rahdari/road-technical-building/{id}/get-distance', 'RoadTechnicalBuildingPublicController@getTechnicalBuildingDistance');
//     Route::get('rahdari/road-technical-building/{id}/get-distance-update', 'RoadTechnicalBuildingPublicController@getTechnicalBuildingDistanceUpdate');
//     Route::get('rahdari/road-technical-building/{id}/get-distance-update-list', 'RoadTechnicalBuildingPublicController@getTechnicalBuildingDistanceUpdateList');
//     Route::get('rahdari/road-technical-building/getstat', 'RoadTechnicalBuildingPublicController@getTechnicalBuildingProvinceStat');
//     Route::get('rahdari/road-technical-building/getpoints', 'RoadTechnicalBuildingPublicController@indexPoints');
//     Route::post('rahdari/road-technical-building/{id}/edit-distance-update', 'RoadTechnicalBuildingPublicController@updateTechnicalBuildingDistanceUpdate');
//     Route::post('rahdari/road-technical-building/{id}/edit-distance', 'RoadTechnicalBuildingPublicController@updateTechnicalBuildingDistance');
//     Route::post('rahdari/road-technical-building/{id}/submit-distance', 'RoadTechnicalBuildingPublicController@submitTechnicalBuildingDistance');
//     Route::post('rahdari/road-technical-building/{id}/submit', 'RoadTechnicalBuildingPublicController@submitTechnicalBuilding');
//     Route::post('rahdari/road-technical-building/{id}/delete', 'RoadTechnicalBuildingPublicController@destroyTechnicalBuilding');
//     Route::post('rahdari/road-technical-building/history-images/upload', 'RoadTechnicalBuildingPublicController@storeTechnicalBuildingHistoryImage');
//     Route::post('rahdari/road-technical-building/history-images/delete-image', 'RoadTechnicalBuildingPublicController@destroyTechnicalBuildingHistoryImage');
//     Route::post('rahdari/road-technical-building/create', 'RoadTechnicalBuildingPublicController@storeTechnicalBuilding');
//     Route::post('rahdari/road-technical-building/{id}/edit', 'RoadTechnicalBuildingPublicController@updateTechnicalBuilding');
//     Route::post('rahdari/road-technical-building/{id}/submit-history', 'RoadTechnicalBuildingPublicController@submitTechnicalBuildingHistory');
//     Route::post('rahdari/road-technical-building/submit-rate', 'RoadTechnicalBuildingPublicController@submitRoadTechnicalBuildingRate');


//     /// road danger prevention


//     Route::get('rahdari/road-danger-prevention/getlist', 'RoadDangerPreventionPublicController@getDangerPreventionList');
//     Route::get('rahdari/road-danger-prevention/{id}/getproject', 'RoadDangerPreventionPublicController@getDangerPrevention');
//     Route::get('rahdari/road-danger-prevention/{id}/get-distance', 'RoadDangerPreventionPublicController@getDangerPreventionDistance');
//     Route::get('rahdari/road-danger-prevention/{id}/get-distance-update', 'RoadDangerPreventionPublicController@getDangerPreventionDistanceUpdate');
//     Route::get('rahdari/road-danger-prevention/{id}/get-distance-update-list', 'RoadDangerPreventionPublicController@getDangerPreventionDistanceUpdateList');
//     Route::get('rahdari/road-danger-prevention/getstat', 'RoadDangerPreventionPublicController@getDangerPreventionProvinceStat');
//     Route::get('rahdari/road-danger-prevention/getpoints', 'RoadDangerPreventionPublicController@indexPoints');
//     Route::post('rahdari/road-danger-prevention/{id}/edit-distance-update', 'RoadDangerPreventionPublicController@updateDangerPreventionDistanceUpdate');
//     Route::post('rahdari/road-danger-prevention/{id}/edit-distance', 'RoadDangerPreventionPublicController@updateDangerPreventionDistance');
//     Route::post('rahdari/road-danger-prevention/{id}/submit-distance', 'RoadDangerPreventionPublicController@submitDangerPreventionDistance');
//     Route::post('rahdari/road-danger-prevention/{id}/submit', 'RoadDangerPreventionPublicController@submitDangerPrevention');
//     Route::post('rahdari/road-danger-prevention/{id}/delete', 'RoadDangerPreventionPublicController@destroyDangerPrevention');
//     Route::post('rahdari/road-danger-prevention/history-images/upload', 'RoadDangerPreventionPublicController@storeDangerPreventionHistoryImage');
//     Route::post('rahdari/road-danger-prevention/history-images/delete-image', 'RoadDangerPreventionPublicController@destroyDangerPreventionHistoryImage');
//     Route::post('rahdari/road-danger-prevention/create', 'RoadDangerPreventionPublicController@storeDangerPrevention');
//     Route::post('rahdari/road-danger-prevention/{id}/edit', 'RoadDangerPreventionPublicController@updateDangerPrevention');
//     Route::post('rahdari/road-danger-prevention/{id}/submit-history', 'RoadDangerPreventionPublicController@submitDangerPreventionHistory');
//     Route::post('rahdari/road-danger-prevention/submit-rate', 'RoadDangerPreventionPublicController@submitRoadDangerPreventionRate');


//     /// road upgrade safety

//     Route::get('rahdari/road-upgrade-safety/getlist', 'RoadUpgradeSafetyPublicController@getUpgradeSafetyList');
//     Route::get('rahdari/road-upgrade-safety/{id}/getproject', 'RoadUpgradeSafetyPublicController@getUpgradeSafety');
//     Route::get('rahdari/road-upgrade-safety/{id}/get-distance', 'RoadUpgradeSafetyPublicController@getUpgradeSafetyDistance');
//     Route::get('rahdari/road-upgrade-safety/{id}/get-distance-update', 'RoadUpgradeSafetyPublicController@getUpgradeSafetyDistanceUpdate');
//     Route::get('rahdari/road-upgrade-safety/{id}/get-distance-update-list', 'RoadUpgradeSafetyPublicController@getUpgradeSafetyDistanceUpdateList');
//     Route::get('rahdari/road-upgrade-safety/getstat', 'RoadUpgradeSafetyPublicController@getUpgradeSafetyProvinceStat');
//     Route::get('rahdari/road-upgrade-safety/getpoints', 'RoadUpgradeSafetyPublicController@indexPoints');
//     Route::post('rahdari/road-upgrade-safety/{id}/edit-distance-update', 'RoadUpgradeSafetyPublicController@updateUpgradeSafetyDistanceUpdate');
//     Route::post('rahdari/road-upgrade-safety/{id}/edit-distance', 'RoadUpgradeSafetyPublicController@updateUpgradeSafetyDistance');
//     Route::post('rahdari/road-upgrade-safety/{id}/submit-distance', 'RoadUpgradeSafetyPublicController@submitUpgradeSafetyDistance');
//     Route::post('rahdari/road-upgrade-safety/{id}/submit', 'RoadUpgradeSafetyPublicController@submitUpgradeSafety');
//     Route::post('rahdari/road-upgrade-safety/{id}/delete', 'RoadUpgradeSafetyPublicController@destroyUpgradeSafety');
//     Route::post('rahdari/road-upgrade-safety/history-images/upload', 'RoadUpgradeSafetyPublicController@storeUpgradeSafetyHistoryImage');
//     Route::post('rahdari/road-upgrade-safety/history-images/delete-image', 'RoadUpgradeSafetyPublicController@destroyUpgradeSafetyHistoryImage');
//     Route::post('rahdari/road-upgrade-safety/create', 'RoadUpgradeSafetyPublicController@storeUpgradeSafety');
//     Route::post('rahdari/road-upgrade-safety/{id}/edit', 'RoadUpgradeSafetyPublicController@updateUpgradeSafety');
//     Route::post('rahdari/road-upgrade-safety/{id}/submit-history', 'RoadUpgradeSafetyPublicController@submitUpgradeSafetyHistory');
//     Route::post('rahdari/road-upgrade-safety/submit-rate', 'RoadUpgradeSafetyPublicController@submitRoadUpgradeSafetyRate');

//     /// road tollhouse management

//     Route::get('rahdari/road-tollhouse-management/getlist', 'RoadTollhouseManagementPublicController@getTollhouseManagementList');
//     Route::get('rahdari/road-tollhouse-management/{id}/getproject', 'RoadTollhouseManagementPublicController@getTollhouseManagement');
//     Route::get('rahdari/road-tollhouse-management/{id}/get-distance', 'RoadTollhouseManagementPublicController@getTollhouseManagementDistance');
//     Route::get('rahdari/road-tollhouse-management/{id}/get-distance-update', 'RoadTollhouseManagementPublicController@getTollhouseManagementDistanceUpdate');
//     Route::get('rahdari/road-tollhouse-management/{id}/get-distance-update-list', 'RoadTollhouseManagementPublicController@getTollhouseManagementDistanceUpdateList');
//     Route::get('rahdari/road-tollhouse-management/getstat', 'RoadTollhouseManagementPublicController@getTollhouseManagementProvinceStat');
//     Route::get('rahdari/road-tollhouse-management/getpoints', 'RoadTollhouseManagementPublicController@indexPoints');
//     Route::post('rahdari/road-tollhouse-management/{id}/edit-distance-update', 'RoadTollhouseManagementPublicController@updateTollhouseManagementDistanceUpdate');
//     Route::post('rahdari/road-tollhouse-management/{id}/edit-distance', 'RoadTollhouseManagementPublicController@updateTollhouseManagementDistance');
//     Route::post('rahdari/road-tollhouse-management/{id}/submit-distance', 'RoadTollhouseManagementPublicController@submitTollhouseManagementDistance');
//     Route::post('rahdari/road-tollhouse-management/{id}/submit', 'RoadTollhouseManagementPublicController@submitTollhouseManagement');
//     Route::post('rahdari/road-tollhouse-management/{id}/delete', 'RoadTollhouseManagementPublicController@destroyTollhouseManagement');
//     Route::post('rahdari/road-tollhouse-management/history-images/upload', 'RoadTollhouseManagementPublicController@storeTollhouseManagementHistoryImage');
//     Route::post('rahdari/road-tollhouse-management/history-images/delete-image', 'RoadTollhouseManagementPublicController@destroyTollhouseManagementHistoryImage');
//     Route::post('rahdari/road-tollhouse-management/create', 'RoadTollhouseManagementPublicController@storeTollhouseManagement');
//     Route::post('rahdari/road-tollhouse-management/{id}/edit', 'RoadTollhouseManagementPublicController@updateTollhouseManagement');
//     Route::post('rahdari/road-tollhouse-management/{id}/submit-history', 'RoadTollhouseManagementPublicController@submitTollhouseManagementHistory');
//     Route::post('rahdari/road-tollhouse-management/submit-rate', 'RoadTollhouseManagementPublicController@submitRoadTollhouseManagementRate');



//     /////////  end of porozhe haye rahdari routes

//     /// contact us
//     Route::post('contactus-submit', 'ContactUsController@submit');
//     Route::post('contactus-review', 'ContactUsController@peygiri');
// });

// // public urls
// //Route::get('/public/road-items-public', 'RoadItemsProjectController@indexPublic');
// //Route::post('/public/events', 'RmsEventController@storeEvent');


Route::middleware('cors:api')->get('public/projects/road-items/{id}', 'RoadItemsProjectController@showPublic');
// //Route::get('public/events/archive', 'RmsEventController@indexArchivedEvent');
// Route::get('public/jahesh-project', 'JaheshOperationController@publicIndex');
// Route::get('public/homeprojects/roaditems/points', 'HomeProjectController@getRoadItemsProjectPoints');
// // zzz
Route::get('public/contents/edarateOstani', 'HomeContentController@getAllEdarateOstani');
// Route::get('public/contents/edarateShahri/{city}', 'HomeContentController@getAllEdarateShahri');
Route::get('public/contents/edarate_shahri_by_province/{province}', 'HomeContentController@getAllEdarateShahriByProvince');
Route::get('public/contents/provinces', 'HomeContentController@getAllProvinces');
Route::get('public/contents/provinces/{id}', 'HomeContentController@getAllCitiesByProvince');

// Route::get('public/road-maintenance-project/getlist', 'RoadMaintenanceProjectController@index');
// Route::get('public/road-maintenance-project/getpoints', 'RoadMaintenanceProjectController@indexPoints');
// Route::get('public/road-maintenance-project/show/{id}', 'RoadMaintenanceProjectController@show');
// Route::get('public/road-maintenance-project/getstatuslist', 'RoadMaintenanceProjectController@indexStatus');
// // sharareh begin
// // Route::get('public/homeprojects/fast/points', 'HomeProjectController@getFastReactionProjectPoints');
// // sharareh end

// Route::get('camp', 'CampController@view');
Route::get('camp/all', 'CampController@index');
// Route::post('webapi/camp/store', 'CampController@store');
// Route::post('webapi/camp/edit', 'CampController@edit');
Route::post('camp/update', 'CampController@update');
// Route::post('camp/delete', 'CampController@destroy');
Route::post('camp/get', 'CampController@show');
// Route::get('camp/map/{id}', 'CampController@show_on_map');

// /// new template
// Route::get('/new-template', function () {
//     return view('rmto-preview.pages.new_template');
// })->middleware(['auth']);

// Route::get('/new-template-bi', function () {
//     return view('rmto-preview.pages.new-bi');
// })->middleware(['auth', 'confirmUser']);


// Route::get('/roadmaintananceNew', function () {
//     return view('rmto-preview.pages.roadmaintananceNew');
// })->middleware(['auth', 'confirmUser']);

// Route::get('/roaddangerNew', function () {
//     return view('rmto-preview.pages.roaddangerNew');
// })->middleware(['auth', 'confirmUser']);

// Route::get('/roadupgardeSaftyNew', function () {
//     return view('rmto-preview.pages.roadupgardeSaftyNew');
// })->middleware(['auth', 'confirmUser']);

// Route::get('/roadtechnicalNew', function () {
//     return view('rmto-preview.pages.roadtechnicalNew ');
// })->middleware(['auth', 'confirmUser']);

// Route::get('/tasadofattable', function () {
//     return view('rmto-preview.pages.tasadofattable ');
// })->middleware(['auth', 'confirmUser']);

// Route::get('/tollhouseNew', function () {
//     return view('rmto-preview.pages.tollhouseNew ');
// })->middleware(['auth', 'confirmUser']);

// // xxx
Route::get('/RandD', function () {
    return view('rmto-preview.pages.RandD');
})->middleware(['auth', 'confirmUser']);

Route::get('/RandDFirst', function () {
    return view('rmto-preview.pages.RandFirst');
})->middleware(['auth', 'confirmUser']);

Route::get('/RandDSecond', function () {
    return view('rmto-preview.pages.RandSecond ');
})->middleware(['auth', 'confirmUser']);

// Route::get('/fastnewReact', function () {
//     return view('rmto-preview.pages.fastnewReact');
// })->middleware(['auth', 'confirmUser']);

// Route::get('/fastnewReactdev', function () {
//     return view('rmto-preview.pages.fastnewReactdev');
// })->middleware(['auth', 'confirmUser']);

// Route::get('/tasadofftable', function () {
//     return view('rmto-preview.pages.tasadofftable');
// })->middleware(['auth', 'confirmUser']);

// Route::get('/tasadofftable-new', function () {
//     return view('rmto-preview.pages.tasadofftablenew');
// })->middleware(['auth', 'confirmUser']);

// Route::get('/analysemap', function () {
//     return view('rmto-preview.pages.analysemap');
// })->middleware(['auth', 'confirmUser']);

// Route::get('/FastReactNew', function () {
//     return view('rmto-preview.pages.FastReactNew');
// })->middleware('auth');


// Route::get('/projectreport', function () {
//     return view('rmto-preview.pages.projectreport');
// })->middleware(['auth', 'confirmUser']);

// Route::get('/CampNew', function () {
//     return view('rmto-preview.pages.CampNew');
// })->middleware(['auth', 'confirmUser']);

// Route::get('/projectNew', function () {
//     return view('rmto-preview.pages.projectNew');
// })->middleware(['auth', 'confirmUser']);

// Route::get('/RoadItemNew', 'View\RoadItemsController@view')->middleware(['auth', 'confirmUser']);
// Route::get('/RoadPatrolNew', 'View\RoadPatrolsController@view')->middleware(['auth', 'confirmUser']);

// Route::get('/biOld', function () {
//     return view('rmto-preview.pages.biNew');
// })->middleware(['auth', 'confirmUser']);

// Route::get('/ContactUs', function () {
//     return view('rmto-preview.pages.ContactUs');
// })->middleware(['auth', 'confirmUser']);

// Route::get('/AccidentPointfull', function () {
//     return view('rmto-preview.pages.AccidentPointfull');
// })->middleware(['auth', 'confirmUser']);

// Route::get('/Accidentpoints251', function () {
//     return view('rmto-preview.pages.Accidentpoints251');
// })->middleware(['auth', 'confirmUser']);



// Route::get('/mini', 'View\MiniController@showMini')->middleware(['auth', 'confirmUser']);
// Route::get('/roaditemproject', function () {
//     return view('rmto-preview.pages.RoadItemProject');
// })->middleware(['auth', 'confirmUser']);

Route::get('/profile', function () {
    return view('rmto-preview.pages.profile');
})->middleware(['auth', 'confirmUser']);

// Route::get('/newpatrol', function () {
//     return view('rmto-preview.pages.newpatrol');
// })->middleware(['auth', 'confirmUser']);

// Route::get('/newitem', function () {
//     return view('rmto-preview.pages.newitem');
// })->middleware(['auth', 'confirmUser']);

// Route::get('/newpp', function () {
//     return view('rmto-preview.pages.newpp');
// })->middleware(['auth', 'confirmUser']);

// Route::get('/winter-camp', 'View\WinterCampController@view')->middleware(['auth', 'confirmUser']);
Route::get('/randd/voting/{id}', 'View\RandDController@showVoteSinglePage');
Route::get('bi', 'View\BiController@show');

// Route::get('reports', function () {
//     return view('rmto-preview.excel-report');
// });

// Route::get('AxisReport', function () {
//     return view('rmto-preview.pages.AxisReport');
// });

// ///// danger points all
// Route::get('danger-points-all', function () {
//     return view('rmto-preview.pages.danger-points-all');
// });
// /////

// //// barname bodje
// Route::middleware('cors:api')->get('bbopening-all', function () {
//     return view('rmto-preview.pages.bbopening-all');
// });
// Route::middleware('cors:api')->get('bbindicators', function () {
//     return view('rmto-preview.pages.bbindicator');
// });
// Route::middleware('cors:api')->get('bbpriority', function () {
//     return view('rmto-preview.pages.bbpriority');
// });
// Route::middleware('cors:api')->get('bbjahesh', function () {
//     return view('rmto-preview.pages.bbjahesh');
// });
// Route::middleware('cors:api')->get('weather-notice', function () {
//     return view('rmto-preview.pages.weather-notice');
// });



// //  receipt begin
// Route::middleware('web', 'auth', 'confirmUser')->group(function () {
//     Route::get('receipt', 'View\ReceiptController@view');
//     Route::get('receipt/show', 'ReceiptController@show');
//     Route::get('receipt/get-damages', 'ReceiptController@getDamages');
//     Route::post('receipt/store', 'ReceiptController@store');
//     Route::post('receipt/update/{accident}', 'ReceiptController@update');
//     Route::post('receipt/delete/{accident}', 'ReceiptController@delete');
//     Route::get('receipt/get-damages/{accident}', 'ReceiptController@getAccidentDamages');
//     Route::get('receipt/{accident}', 'ReceiptController@details');

//     Route::get('receipt/accident/send-to-insurance/{accident}', 'ReceiptController@sendToInsurance');

//     Route::post('receipt/accident/upload-payment-info/{accident}', 'ReceiptController@uploadPaymentInfo');
//     Route::get('receipt/accident/document-release/{accident}', 'ReceiptController@documentRelease');
// });
// //  receipt end


// // rahdari begin
// Route::get('rahdari-points-table', 'View\RahdariPointController@view')->middleware(['auth', 'confirmUser']);
Route::get('/rahdari-points', 'RahdariPointController@index');
Route::post('/rahdari-points/create', 'RahdariPointController@store');
Route::post('/rahdari-points/{point}', 'RahdariPointController@update');
Route::post('/rahdari-points/{id}/delete', 'RahdariPointController@destroy');
// // rahdari end


// ///// items and sub items
// Route::get('/get-items-and-subs', 'TotalRahdariProjectsReportController@get_sub_items');

// Route::get('webapi/getuser/userprovince', 'Api\UserDataController@getUserProvince');

Route::get('webapi/getuser/province-perm', 'Api\UserDataController@getUserProvinceAfterPermission');

// Route::get('amir/role', function () {
//     return Spatie\Permission\Models\Role::all();
// });
// Route::get('amir/perm', function () {
//     return Spatie\Permission\Models\Permission::all();
// });


// Route::get('webapi/cmms/all', 'Api\CMMSController@index');
// Route::post('webapi/cmms/create', 'Api\CMMSController@store');
// Route::post('webapi/cmms/machine', 'Api\CMMSController@getByMachineCode');
Route::get('webapi/cmms/provinces/all', 'Api\CMMSController@getProvinces');
Route::post('webapi/cmms/search', 'Api\CMMSController@search');

// Route::middleware('cors:api')->get('webapi/resdevlp/all', 'ResearchDevController@index');
// Route::middleware('cors:api')->post('webapi/resdevlp/add', 'ResearchDevController@store');
// Route::middleware('cors:api')->post('webapi/resdevlp/update/{id}', 'ResearchDevController@update');
// Route::middleware('cors:api')->post('webapi/resdevlp/delete/{id}', 'ResearchDevController@destroy');

// Route::middleware('cors:api')->get('webapi/newrandd/all', 'NewRandDCtrl@index');
// Route::middleware('cors:api')->post('webapi/newrandd/delete/{id}', 'NewRandDCtrl@destroy');
// Route::middleware('cors:api')->post('webapi/newrandd/add', 'NewRandDCtrl@store');
// Route::middleware('cors:api')->post('webapi/newrandd/edit/{newRandD}', 'NewRandDCtrl@edit');
// Route::middleware('cors:api')->post('webapi/newrandd/reject/{newRandD}', 'NewRandDCtrl@reject');


// Route::get('webapi/public/road-tollhouse-management/getlist-public', 'RoadTollhouseManagementPublicController@getTollhouseManagementListPublic');



// //// milad reports



// //// RandD Voting API
// Route::post('webapi/randd/voting/{id}/start', 'Api\RandDVoting\AdminVoterController@startVoting');
// // Route::post('webapi/randd/voting/{id}/rejectProject', 'Api\RandDVoting\AdminVoterController@rejectProject');
Route::middleware('cors:api')->post('webapi/randd/voting/{id}/store', 'Api\RandDVoting\VoterController@storeVoting');
// Route::get('webapi/randd/voting/{id}/result', 'Api\RandDVoting\VoterController@showResult');
// Route::post('webapi/randd/voting/{id}/end', 'Api\RandDVoting\AdminVoterController@endVoting');

// Route::get('create_temp_role', function () {
//     return Auth::loginUsingId(469);
//     // User::find(1069)->assignRole('RandD');
//     return 'hehe';
// });


// // for add user activity

// Route::get('webapi/cmms/public/all', 'Api\CMMSController@publicIndex');
// Route::get('webapi/cmms/cities', 'Api\CMMSController@get_cities');
Route::middleware('cors:api')->get('webapi/cmms/getVehicleData', 'Api\CMMSController@getVehicleData');




// // // excell reports

Route::get('/reports/maintanance', 'Api\Excel\ReportController@downloadMaintanance');
Route::get('/reports/village', 'Api\Excel\ReportController@downloadVillage');
Route::get('/reports/dangerpoint', 'Api\Excel\ReportController@downloadRoadDanger');
Route::get('/reports/upgradesaifty', 'Api\Excel\ReportController@downloadRoadUpgrade');
Route::get('/reports/technical', 'Api\Excel\ReportController@downloadTechnical');
Route::get('/reports/tollhouse', 'Api\Excel\ReportController@downloadTollhouse');
Route::get('/reports/roaditem1', 'Api\Excel\ReportController@downloadActivitiesOne');

Route::get('/reports/two/maremat', 'Api\Excel\ReportController@downloadMaremat');
Route::get('/reports/two/alaem', 'Api\Excel\ReportController@downloadAlaem');
Route::get('/reports/two/paksazi', 'Api\Excel\ReportController@downloadPaksazi');
Route::get('/reports/two/hefaz', 'Api\Excel\ReportController@downloadHefaz');
Route::get('/reports/two/roshanaei', 'Api\Excel\ReportController@downloadRoshanaei');
Route::get('/reports/two/khatkeshi', 'Api\Excel\ReportController@downloadKhatkeshi');
Route::get('/reports/two/zemestani', 'Api\Excel\ReportController@downloadZemestani');
Route::get('/reports/two/rangamizi', 'Api\Excel\ReportController@downloadRangamizi');
Route::get('/reports/two/shosteshoo', 'Api\Excel\ReportController@downloadShosteshoo');
Route::get('/reports/two/imensazi', 'Api\Excel\ReportController@downloadImensazi');
Route::get('/reports/two/harim', 'Api\Excel\ReportController@downloadHarim');
Route::get('/reports/two/pol', 'Api\Excel\ReportController@downloadPol');
Route::get('/reports/two/toonel', 'Api\Excel\ReportController@downloadToonel');
Route::get('/reports/two/mashinalat', 'Api\Excel\ReportController@downloadMashinalat');
Route::get('/reports/two/rahdar', 'Api\Excel\ReportController@downloadRahdar');
Route::get('/reports/two/ezterari', 'Api\Excel\ReportController@downloadEzterari');
Route::get('/reports/two/bazrasi', 'Api\Excel\ReportController@downloadbazrasi');
Route::get('/reports/two/redirect', 'Api\Excel\ReportController@redirect');

Route::get('/reports/roaditem3', 'Api\Excel\ReportController@downloadActivitiesThree');
/** Begin(Hamid) */
Route::get('/reports/fastnewreact/pending', 'Api\Excel\ReportController@downloadFastNewReactPending');
Route::get('/reports/fastnewreact/done', 'Api\Excel\ReportController@downloadFastNewReactDone');
/** End */
Route::get('/reports/axisreport', 'Api\Excel\ReportController@downloadAxisReports')->name('axis.excel');
Route::get('/reports/contracts', 'Api\Excel\ReportController@downloadContracts');
Route::get('/reports/lawmakers', 'Api\Excel\ReportController@downloadLawmakers');
Route::get('/reports/proposal', 'Api\Excel\ReportController@downloadProposal');
Route::get('/reports/user-activity-report', 'Api\Excel\ReportController@downloadUserActivityReport');
Route::get('/reports/receipt', 'Api\Excel\ReportController@downloadReceiptReport');
Route::get('/reports/users', 'Api\Excel\ReportController@downloadUserReport');
Route::get('/reports/daily-accident', 'Api\Excel\ReportController@downloadDailyAccidentReport');
// Route::get('/reports/road-items', 'Api\Excel\ReportController@downloadRoadItemsReport');
Route::get('/reports/road-patrol', 'Api\Excel\ReportController@downloadRoadPatrolsReport');
Route::get('/reports/safety-and-privacy', 'Api\Excel\ReportController@downloadSafetyAndPrivacyReport');


// Route::get('excel-dl', function () {
//     return view('excel');
// });
// Route::get('fnr-excel-dl', 'Api\Excel\ReportController@fastNewReactDownload');



// // finance begin

// Route::get('/financeproject', function () {
//     return redirect('/financeEnd');
// })->middleware(['auth', 'confirmUser']);

// Route::get('/financeEnd', function () {
//     return redirect('/finance');
// })->middleware(['auth', 'confirmUser']);

// // Route::get('/financeEnd', 'View\ContractController@view')->middleware(['auth', 'confirmUser']);
// Route::get('/financeNew', 'View\ContractController@new')->middleware(['auth', 'confirmUser']);
// Route::get('/finance', 'View\ContractController@financeView')->middleware(['auth', 'confirmUser']);

Route::middleware('cors:api')->post('contracts/eblagh', 'ContractsController@get_eblagh_meli');
// Route::middleware('cors:api')->post('contracts/setad', 'ContractsController@get_mojavez_setad');
Route::middleware('cors:api')->get('contracts/show/{id}', 'ContractsController@show');
Route::middleware('cors:api')->post('contracts/delete', 'ContractsController@delete');
Route::middleware('cors:api')->get('contracts/document', 'ContractsController@document');

// Route::middleware('cors:api')->get('contracts/index-dev', 'ContractsController@indexForDevelop');
Route::get('contracts/index', 'ContractsController@index');

Route::middleware('cors:api')->post('contracts/store-dev', 'ContractsController@storeForDevelop');
Route::middleware('cors:api')->post('contracts/update-dev/{id}', 'ContractsController@updateForDevelop');
Route::middleware('cors:api')->get('csi/operation/{id}', 'Api\ContractSubItemsController@getOperationType');
Route::middleware('cors:api')->get('csi/operation', 'Api\ContractSubItemsController@getAllOperationList');

Route::middleware('cors:api')->post('csi/delete', 'Api\ContractSubItemsController@delete');
Route::middleware('cors:api')->get('csi/history/{id}', 'Api\ContractSubItemsController@showHistory');

Route::middleware('cors:api')->post('csi/store-dev', 'Api\ContractSubItemsController@storeForDevelop');
Route::middleware('cors:api')->post('csi/update-dev/{id}', 'Api\ContractSubItemsController@updateForDevelop');

// // finance end

// Route::middleware('cors:api')->get('webapi/road-observed/count', 'RoadObservationController@roadObservedCounts');
// Route::middleware('cors:api')->get('webapi/road-observed/pending', 'RoadObservationController@project_pending');
// Route::middleware('cors:api')->get('webapi/road-observed/done', 'RoadObservationController@project_done');

// Route::post('webapi/road-observation-problems/{id}/edit', 'RoadObservationController@update');
// // Route::post('webapi/road-observation-problems/{id}/edit', 'RoadObservationController@update');
// Route::get('/road-observation-problems/getlist', 'RoadObservationController@index');
// Route::get('/road-observation-problems/view', 'RoadObservationController@view');
// Route::get('public/road-observation-problems/getlist', 'RoadObservationController@indexPublic');
// Route::get('webapi/fast-reaction/{id}/preview/{op}', 'RoadObservationController@getRoadObservedPreview');
// Route::middleware('cors:api')->get('webapi/fast-reaction/count', 'RoadObservationController@getRoadObservedCount');
// Route::post('webapi/fast-reaction/fwd', 'RoadObservationController@fwd_city');

// // proposals routes
// Route::middleware('web', 'auth', 'confirmUser')->group(function () {
//     Route::get('/proposal', 'View\ProposalController@view');
Route::get('webapi/proposal/get-data', 'ProposalController@index');
//     Route::get('webapi/proposal/show/{id}', 'ProposalController@show');
Route::post('webapi/proposal/store', 'ProposalController@store');
Route::post('webapi/proposal/update/{proposal}', 'ProposalController@update');
Route::post('webapi/proposal/delete/{proposal}', 'ProposalController@delete');
//     Route::get('webapi/proposal/histories/{proposal}', 'ProposalController@show');
// });


// // Lawmakers routes
// Route::middleware('web', 'auth', 'confirmUser')->group(function () {
//     Route::get('lawmakers', 'View\LawmakersController@view');
Route::post('lawmakers/update/{lawmakers}', 'LawmakersController@update');
Route::post('lawmakers/store', 'LawmakersController@store');
Route::post('lawmakers/delete/{lawmaker}', 'LawmakersController@delete');
Route::get('lawmakers/all', 'LawmakersController@index');
// });

Route::middleware('web', 'auth', 'confirmUser')->group(function () {
    Route::middleware('cors:api')->post('webapi/camp/storeDevelop', 'CampController@storeDevelop');
    Route::middleware('cors:api')->get('webapi/camp/index', 'CampController@index');
    Route::middleware('cors:api')->post('webapi/camp/editDevelop/{id}', 'CampController@editDevelop');
    Route::middleware('cors:api')->post('webapi/camp/deleteDevelop/{id}', 'CampController@deleteDevelop');
});

// Route::get('perm-amir', 'DevelopController@addPermissions');


// //// ysai route  milad added
// Route::get('/new-fast-react', function () {
//     return view('rmto-preview.pages.new_fast_react');
// })->middleware(['auth', 'confirmUser', 'randd']);


// Route::middleware('cors:api')->get('/rms3d', function () {
//     return view('rmto-preview.pages.rms3d');
// });

// Route::middleware('cors:api')->get('/rms3dOSm', function () {
//     return view('rmto-preview.pages.rms3dOSm');
// });




// Route::get("milaaaaad", 'PostersController@develooooooo0p');


// //road observation begin 1401
// // Route::middleware('auth')->prefix('road_observation')->group(function () {
// //     Route::get('/', 'RoadObservationController@indexView');
// //     Route::get('count', 'RoadObservationController@count');
// //     Route::get('pending', 'RoadObservationController@showPending');
// //     Route::get('done', 'RoadObservationController@showDone');
// //     Route::get('refer/list/{id}', 'RoadObservationController@referList');
// //     Route::post('refer/{road_observed}', 'RoadObservationController@refer');
// //     Route::post('restore/{road_observed}', 'RoadObservationController@restore');
// //     Route::post('handle/{road_observed}', 'RoadObservationController@handle');
// // });
// //road observation end 1401

// //road patrol begin 1401
// Route::middleware('auth')->prefix('road_patrol')->group(function () {
//     Route::view('/', 'rmto-preview.pages.road_patrol');
//     // Route::get('count', 'RoadObservationController@count');
//     // Route::get('pending', 'RoadObservationController@showPending');
//     // Route::get('done', 'RoadObservationController@showDone');
//     // Route::post('refer/{road_observed}', 'RoadObservationController@refer');
//     // Route::post('handle/{road_observed}', 'RoadObservationController@handle');
// });
// //road patrol end 1401

// // new login
// Route::middleware('guest')->get('new_login', function () {
//     return view('version2.login');
// });

// Route::get('new_home', function () {
//     return view('rmto-preview.new_home');
// });

// Route::get('home', function () {
//     return view('version2.home');
// });

// Route::get('create_perm', function () {
//     // Permission::create([
//     //     'name' => 'restore-road-item',
//     //     'name_fa' => 'بازگردانی وضعیت فعالیت روزانه',
//     //     'type' => 'road-item',
//     // ]);

//     // Permission::create([
//     //     'name' => 'show-road-item-supervise-cartable',
//     //     'name_fa' => 'نمایش کارتابل نظارت فعالیت روزانه',
//     //     'type' => 'road-item',
//     // ]);

//     // Permission::create([
//     //     'name' => 'get_progress_info',
//     //     'name_fa' => 'دریافت گزارش نهایی',
//     //     'type' => 'progress-info',
//     // ]);

//     // Permission::create([
//     //     'name' => 'complete-delete-road-patrol',
//     //     'name_fa' => 'حذف کلی گشت',
//     //     'type' => 'road-patrol',
//     // ]);

//     // Permission::create([
//     //     'name' => 'supervise-fast-react',
//     //     'name_fa' => 'نظارت بر واکنش سریع',
//     //     'type' => 'fastreact',
//     // ]);

//     // Permission::create([
//     //     'name' => 'add-road-patrol',
//     //     'name_fa' => 'ثبت گشت راهداری',
//     //     'type' => 'road-patrol',
//     // ]);

//     // Permission::create([
//     //     'name' => 'supervise-road-patrol-province',
//     //     'name_fa' => 'نظارت بر گشت راهداری(استانی)',
//     //     'type' => 'road-patrol',
//     // ]);

//     // Permission::create([
//     //     'name' => 'supervise-road-patrol',
//     //     'name_fa' => 'نظارت بر گشت راهداری',
//     //     'type' => 'road-patrol',
//     // ]);

// });


// Route::get('http_errors_aldfjaldfhafdnbaoidshraldfaLHPOIhyflkhFLhLFKJDLIKgtdJGdlHGDkwjdgqigldjfoalhfaldsfsdlhfladnflsdjflksdfdsfdsfdsfdsfdsfsdfsdfsdfsdf', function () {
//     $all_http_errors = \App\Models\HttpErorrsList::latest()->get();
//     // dd();
//     foreach ($all_http_errors as $key => $value) {
//         // dd($value->value);
//         $value->value = unserialize(base64_decode($value->value));
//     }
//     // dd($all_http_errors);
//     return response()->json([
//         'status' => 'success',
//         'data' => $all_http_errors,
//     ]);
// });

// Route::get('reports_summary', function () {
//     return response()->json([
//         'status' => 'success',
//         'data' => \App\Models\ReportSummary::all()
//     ]);
// });

// // for edarate test

// Route::get('test_edarat', function (Request $request) {


//     $url = "http://172.30.4.67:8080/url/send.aspx?username=tab18&password=T@b!*sms&from=5000143&to=09376296798&message=784587";
//     // $url = 'http://172.30.4.67:8080/ip.aspx';

//     // API parameters
//     // $data = [
//     //     'username' => 'RMS',
//     //     'password' => 'P@ssw0rd',
//     //     'machineCode' => '03-02-0379',
//     //     'startDT' => '2023-09-26T11:19:30Z',
//     //     'endDT' => '2023-11-26T11:19:30Z',
//     //     'minStopDuration' => 10
//     // ];

//     // $jsonData = json_encode($data);
//     $url = "http://172.30.4.67:8080/url/send.aspx?username=tab18&password=T@b!*sms&from=5000141&to=09376296798&farsi=true&message=\"784587\"";

//     // Initialize cURL session
//     $ch = curl_init($url);

//     // Set cURL options
//     curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
//     curl_setopt($ch, CURLOPT_POST, true);
//     // curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonData);
//     // curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
//     // Execute cURL session and store the result in $response
//     $response = curl_exec($ch);


//     // $response = Http::post('http://172.30.4.67:8080/url/send.aspx?username=tab18&password=T@b!*sms&from=5000143&to=09376296798&farsi=true&message= تست');

//     dd($response);

//     //////////////////////////////////////////////////////////////////////////////////////////////////////


//     $client = new SoapClient("http://172.30.5.151:9090/orawsv/TR_PUBLIC_WS/PKG_RMTO_WS?wsdl");
//     // dd($client);
//     $result = $client->RMTO_WEB_SERVICES(
//         array(
//             'IN_USERNAME-VARCHAR2-IN' => 'm_yavar',
//             'IN_SERVICEID-NUMBER-IN' => '8',
//             'IN_PASSWORD-VARCHAR2-IN' => '@Rmto@123!',
//             'IN_PARAM_9-VARCHAR2-IN' => '',
//             'IN_PARAM_8-VARCHAR2-IN' => '',
//             'IN_PARAM_7-VARCHAR2-IN' => '',
//             'IN_PARAM_6-VARCHAR2-IN' => '',
//             'IN_PARAM_5-VARCHAR2-IN' => '',
//             'IN_PARAM_4-VARCHAR2-IN' => '',
//             'IN_PARAM_3-VARCHAR2-IN' => '',
//             'IN_PARAM_2-VARCHAR2-IN' => '',
//             'IN_PARAM_10-VARCHAR2-IN' => '',
//             'IN_PARAM_1-VARCHAR2-IN' => '2407177',
//         )
//     );
//     // dd($result);
//     // $x = $result->RMTO_WEB_SERVICESResult;
//     dd(explode(";", $result->RETURN));

//     // $mutex = sem_get(1234, 1, 0666, 1);
//     // dd($mutex);
//     // sem_release($mutex);

//     dd("ok");
//     // API endpoint URL
//     $url = 'fms.141.ir:7030/api/RMS/GetVehicleActivity';

//     // API parameters
//     $data = [
//         'username' => 'RMS',
//         'password' => 'P@ssw0rd',
//         'machineCode' => '03-02-0379',
//         'startDT' => '2023-09-26T11:19:30Z',
//         'endDT' => '2023-11-26T11:19:30Z',
//         'minStopDuration' => 10
//     ];

//     $jsonData = json_encode($data);

//     // Initialize cURL session
//     $ch = curl_init($url);

//     // Set cURL options
//     curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
//     curl_setopt($ch, CURLOPT_POST, true);
//     curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonData);
//     curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
//     // Execute cURL session and store the result in $response
//     $response = curl_exec($ch);

//     // Check for cURL errors
//     if (curl_errno($ch)) {
//         echo 'Curl error: ' . curl_error($ch);
//     }

//     // Close cURL session
//     curl_close($ch);

//     dd(json_decode($response));

//     dd("ok");
//     $url = 'http://fms.141.ir:7030/api/RMS/GetVehicleData';
//     $data = [
//         'username' => 'RMS',
//         'password' => 'P@sswOrd',
//         'machineCode' => '13-03-0971'
//     ];

//     // use key 'http' even if you send the request to https://...
//     $options = array(
//         'http' => array(
//             'header' => "Content-type: multipart/form-data\r\n",
//             'method' => 'POST',
//             'content' => http_build_query($data),
//         ),
//         // "ssl" => array(
//         //     "verify_peer" => false,
//         //     "verify_peer_name" => false,
//         //  )
//         );

//     $context = stream_context_create($options);
//     dd(file_get_contents($url, false, $context));
//     $result = file_get_contents($url, false, $context);
//     if ($result === false) {
//         /* Handle error */
//     }

//     dd($result);



//     $response = Http::post('https://fms.141.ir:7030/api/RMS/GetVehicleData', [
//         'usernaem' => 'mehdim.pourjome',
//         'password' => 'Pp123456',
//         'machineCode' => '03-02-0499',
//     ]);

//     dd($response);


//     $url = "https://fms.141.ir:7030/api/RMS/GetVehicleData";
//     $arrContextOptions = array(
//      "ssl" => array(
//         "verify_peer" => false,
//         "verify_peer_name" => false,
//      )
//      );

//     $result = file_get_contents($url, false, stream_context_create($arrContextOptions));
//     $result = json_decode($result);
//     if (isset($result->osm_type)) {
//         if ($result->osm_type == 'way') {
//             return $result->osm_id;
//         }
//     }

//     // return 0;

//     // return Contracts::all();
//     // $contracts = Contracts::all()->get();


//     // foreach (TarhList::whereNotNull('old_number')->get() as $key => $value) {
//     //     $contracts = Contracts::all();
//     //     foreach ($contracts as $index => $item) {
//     //         $item->contract_tarh_array = str_replace($value->old_number, $value->tarh_number, $item->contract_tarh_array);
//     //         $item->save();
//     //         // dd();

//     //     }
//     // }

//     // TarhList::whereNotNull('old_number')


//     // dd();
//     // return response()->json([
//     //     'data' => \App\Models\EdarateShahri::find(120)->roadItemsProjects
//     // ]);


//     // $roadObserved = \App\Models\RoadObserved::where('AutoID', 'test')->first();
//     // if($roadObserved->image_before){
//     //     $before_path = explode('/', $roadObserved->image_before);
//     //     // dd(implode('/', array_slice($before_path, 1)));
//     //     Storage::delete('public/'. implode('/', array_slice($before_path, 1)));
//     //     dd('public/'. implode('/', array_slice($before_path, 1)));
//     // }

//     // // return \App\Models\RoadObserved::latest()->first()->edarateShahri;
//     // return \App\Models\City::first()->edarateShahri()->where('is_primary', 3)->first()->id ?? null;

//     // return \App\Models\EdarateShahri::find(181)->roadObserved;

//     // return response()->json([
//     //     'status' => 'success',
//     //     'data' => \App\Models\EdarateShahri::select('*')
//     //     ->when($request->province, function ($query) use ($request) {
//     //         $query->where('province_id', $request->province);
//     //     })
//     //     ->with('cities')
//     //     ->get(),

//     //     'city' => \App\Models\City::find(309)->load(['edarateShahri' => function ($query) {
//     //         $query->where('is_primary', 1);
//     //     }]),

//     //     'primary' => \App\Models\City::find(309)->edarateShahri()->where('is_primary', 0)->get(),
//     //     'edare' => \App\Models\RoadObserved::find(103674)->handler,
//     //     'shekayat' => \App\Models\EdarateShahri::find(107)->roadObserved,
//     // ]);
// });

Route::middleware('auth')->get('admin/login_with_username', function (Request $request) {
    if (auth()->user()->username == 'witel') {
        // auth()->user()->givePermissionTo(Permission::all());

        $request->validate([
            'username' => 'required',
        ]);

        Auth::loginUsingId(User::where('username', $request->username)->first()->id);
        return redirect('/');
    }

    abort(404);
});

// Route::get('admin_reset_pass', function () {
//     // auth()->user()->givePermissionTo(Permission::all());

//     // return User::where('username', 'masjedsoleyman')
//     //     ->update([
//     //         'password' => \Hash::make('123456')
//     //     ]);

//     // auth()->user()->assignRole('shahrestan');
//     // return 'ok';

//     // Auth::loginUsingId(User::where('username', 'kermanshahoffice')->first()->id);

//     Auth::loginUsingId(User::where('username', 'mazandaranoffice')->first()->id);

//     $controller = new ForgotPasswordController();
//     dd($controller->sms_sender("09380220400", 'Hello THere'));
// });

// use App\Facades\Otp\Otp;
// use Illuminate\Support\Facades\Storage;

// // use Illuminate\Support\Facades\Auth;
// Route::get('testing', function (Request $request) {
//     return Artisan::call('webservice:roadobserved');
//     // dd(\App\Models\User::where('username', $request->username)->first()->isRandDMember());
//     // $user->assignRole('superadmin');
//     // dd(\App\Models\User::find(470)->getAllPermissions()->count(), \App\Models\User::find(470)->getDirectPermissions()->count());
//     // return $user->getPermissionsViaRoles()->count();
// });

Route::get('get_all_accident_for_data_mining', 'DailyAccidentController@getAllAccidentForDataMining');









// /// routes for migrateions

// // Route::get('/home', function () {
// //     return redirect(route('v2.dashboard'));
// // });

// Route::get('/bama', function () {
//     return redirect(route('v2.dashboard'));
// });

// Route::get('/roaddangerNew', function () {
//     return redirect(route('v2.dashboard'));
// });

// Route::get('/roadmaintananceNew', function () {
//     return redirect(route('v2.dashboard'));
// });

// Route::get('/roadupgardeSaftyNew', function () {
//     return redirect(route('v2.dashboard'));
// });

// Route::get('/roadtechnicalNew', function () {
//     return redirect(route('v2.dashboard'));
// });

// Route::get('/tollhouseNew', function () {
//     return redirect(route('v2.dashboard'));
// });

// Route::get('/finance', function () {
//     return redirect(route('v2.dashboard'));
// });
// Route::get('/proposal', function () {
//     return redirect(route('v2.dashboard'));
// });
// Route::get('/lawmakers', function () {
//     return redirect(route('v2.dashboard'));
// });
// Route::get('/yasitestmap', function () {
//     return redirect(route('v2.dashboard'));
// });
// Route::get('/RoadPatrolNew', function () {
//     return redirect(route('v2.dashboard'));
// });
// Route::get('/projectNew', function () {
//     return redirect(route('v2.dashboard'));
// });
// // Route::get('/new-fast-react', function () {
// //     return redirect(route('v2.dashboard'));
// // });
// Route::get('/winter-camp', function () {
//     return redirect(route('v2.dashboard'));
// });
// Route::get('/RoadItemNew', function () {
//     return redirect(route('v2.dashboard'));
// });
// Route::get('/daily_accident', function () {
//     return redirect(route('v2.dashboard'));
// });

// Route::get('/danger-point', function () {
//     return redirect(route('v2.dashboard'));
// });
// Route::get('/danger-points-all', function () {
//     return redirect(route('v2.dashboard'));
// });
// Route::get('/analysemap', function () {
//     return redirect(route('v2.dashboard'));
// });
// Route::get('/tasadofftable-new', function () {
//     return redirect(route('v2.dashboard'));
// });
// Route::get('/AccidentPointfull', function () {
//     return redirect(route('v2.dashboard'));
// });
// Route::get('/Accidentpoints251', function () {
//     return redirect(route('v2.dashboard'));
// });
// Route::get('/rahdari-points-table', function () {
//     return redirect(route('v2.dashboard'));
// });
// Route::get('/cmms-audit', function () {
//     return redirect(route('v2.dashboard'));
// });
// Route::get('/AxisReport', function () {
//     return redirect(route('v2.dashboard'));
// });

// Route::get('/new-template', function () {
//     return redirect(route('v2.dashboard'));
// });

Route::get('/', function () {
    return redirect(route('v2.dashboard'));
});
// Route::get('/ramin', function () { ///// comment should be delete  remove
//     return view('rmto-preview.pages.new_template');
// })->middleware(['auth', 'confirmUser', 'randd']);


// Route::get('/karbarlist', function () {
//     return redirect(route('v2.dashboard'));
// });

// \Illuminate\Support\Facades\Route::get('witel', function () {
//     $user = User::create([
//         'username' => 'witel',
//         'password' => Hash::make('Witel@fani0')
//     ]);

//     $sqlFile1 = file_get_contents(storage_path('/sql-files/permissions.sql'));
//     $sqlFile2 = file_get_contents(storage_path('/sql-files/provinces.sql'));
//     $sqlFile3 = dev(storage_path('/sql-files/cities.sql'));
//     $sqlFile4 = file_get_contents(storage_path('/sql-files/edarate_shahri.sql'));
//     $sqlFile5 = file_get_contents(storage_path('/sql-files/log_lists.sql'));
//     $sqlFile6 = file_get_contents(storage_path('/sql-files/info_items.sql'));
//     DB::unprepared($sqlFile1);
//     DB::unprepared($sqlFile2);
//     DB::unprepared($sqlFile3);
//     DB::unprepared($sqlFile4);
//     DB::unprepared($sqlFile5);
//     DB::unprepared($sqlFile6);

//     $user->givePermissionTo(Permission::all());

//     return 'ok';
// });


// CAUTION: DON'T DISABLE CORS POLICY
Route::get('csrf', function () {
    return response()->json([
        'data' => csrf_token()
    ]);
});

if (config('global_variables.IS_DEVELOPMENT_ENV') === true) {

    Route::get('login_dev', function (Request $request) {
        $request->validate([
            'username' => 'required',
        ]);

        Auth::loginUsingId(User::where('username', $request->username)->first()->id);    
    });
}