<?php

use Illuminate\Http\Request;
use App\Http\Controllers\Api\ApiAuthController;
use App\Http\Controllers\Api\ApiQuestionController;
use App\Http\Controllers\Api\ApiCycleController;
use App\Http\Controllers\Api\ApiSymptomsController;
use App\Http\Controllers\Api\ApiSupportController;

// header('Access-Control-Allow-Origin: *');
// header("Access-Control-Allow-Headers: X-API-KEY, Origin, X-Requested-With, Content-Type, Accept, Access-Control-Request-Method, Authorization");
// header("Access-Control-Allow-Methods: GET, POST, OPTIONS, PUT, DELETE");
/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/


$nor = array("v1", "v2", "v3","v4");
$ver = request()->segment(2);
// dd($ver);

if(in_array($ver, $nor)) 
{
	
   Route::group(['prefix' => '/'.$ver, 'namespace' => 'Api\\'.$ver,], function () {

			//User authentication
			Route::post('/login', 'ApiAuthController@login');

			//Send OTP
			Route::post('/sendotp', 'ApiAuthController@sendotp');

			//Social Login
			Route::post('/sociallogin', 'ApiAuthController@sociallogin');

			//Resend OTP
			Route::post('/resendotp', 'ApiAuthController@resendotp');

			//Profile Update
			Route::post('/editprofile', 'ApiAuthController@editprofile');

			//update contact
			Route::post('/updatecontact', 'ApiAuthController@updatecontact');

			//User Logout
			Route::post('/logout', 'ApiAuthController@logout');




			//All Question And Answers
			Route::get('/getQuestionnaireOptions', 'ApiQuestionController@getQuestionnaireOptions');

			//User Given Question And Answers
			Route::post('/questionnaire', 'ApiQuestionController@questionnaire');
			// Route::post('/questionnaire', [ApiQuestionController::class, 'questionnaire']);


			//User Given Date Only
			Route::post('/questionnaireDate', 'ApiQuestionController@questionnaireDate');
			Route::post('/questionnaireSecond', 'ApiQuestionController@questionnaireSecond');
			Route::post('/questionnaireSecondTest', 'ApiQuestionController@questionnaireSecondTest');


			//User Given Date Only
			Route::post('/test', 'ApiQuestionController@test');

			Route::get('/cron_test', 'ApiQuestionController@cron_test');
			//Cycle
			Route::post('/getCycleData', 'ApiCycleController@getCycleData');


			//Cycle Calender
			Route::post('/getCycleCalendar', 'ApiCycleController@getCycleCalendar');


			//All Category And Symptoms
			Route::get('/getSymptomsOptions', 'ApiSymptomsController@getSymptomsOptions');


			//User Given Category And Symptoms
			Route::post('/submitSymptons', 'ApiSymptomsController@submitSymptons');


			// Help And Support
			Route::post('/submithelpsupport', 'ApiSupportController@submithelpsupport');
			

			// Start Button
			Route::post('/startbutton', 'ApiButtonController@startButton');

			// Stop Button
			Route::post('/stopbutton', 'ApiButtonController@stopButton');

###################################Second Phase########################################					//All Nutration Data
			Route::get('/nutrition', 'ApiNutrationController@getNutritions');

			//All Category
			Route::get('/getAllCategory', 'ApiSymptomsController@getAllCategory');

			//All Symptoms
			Route::get('/getAllSymptoms', 'ApiSymptomsController@getAllSymptoms');

			//Cycle For Local DB
			Route::post('/getCycleDataLocalDB', 'ApiCycleController@getCycleDataLocalDB');

			Route::post('/get_local_data', 'ApiCycleController@get_local_data');


	});
}

			//User authentication
			Route::post('/login', [ApiAuthController::class, 'login']);

			//Send OTP
			Route::post('/sendotp', [ApiAuthController::class, 'sendotp']);

			//Resend OTP
			Route::post('/resendotp', [ApiAuthController::class, 'resendotp']);

			//Profile Update
			Route::post('/editprofile', [ApiAuthController::class, 'editprofile']);

			//update contact
			Route::post('/updatecontact', [ApiAuthController::class, 'updatecontact']);

			//User Logout
			Route::post('/logout', [ApiAuthController::class, 'logout']);




			//All Question And Answers
			Route::get('/getQuestionnaireOptions', [ApiQuestionController::class, 'getQuestionnaireOptions']);

			//User Given Question And Answers
			Route::post('/questionnaire', [ApiQuestionController::class, 'questionnaire']);
			Route::post('/quest', [ApiQuestionController::class, 'quest']);


			//User Given Date Only
			Route::post('/questionnaireDate', [ApiQuestionController::class, 'questionnaireDate']);
			Route::post('/questionnaireSecond', [ApiQuestionController::class, 'questionnaireSecond']);


			//User Given Date Only
			Route::post('/test', [ApiQuestionController::class, 'test']);


			//Cycle
			Route::post('/getCycleData', [ApiCycleController::class, 'getCycleData']);


			//Cycle Calender
			Route::post('/getCycleCalendar', [ApiCycleController::class, 'getCycleCalendar']);


			//All Category And Symptoms
			Route::get('/getSymptomsOptions', [ApiSymptomsController::class, 'getSymptomsOptions']);


			//User Given Category And Symptoms
			Route::post('/submitSymptons', [ApiSymptomsController::class, 'submitSymptons']);



			//All CMS, Help And Support

			// Help And Support
			Route::post('/submithelpsupport', [ApiSupportController::class, 'submithelpsupport']);
