<?php

use Illuminate\Http\Request;
use Illuminate\Support\Facades\Route;
use App\Http\Controller\HomeController;
use App\Http\Controller\CourseController;

Route::get('set', function () {
    Artisan::call('optimize');
    Artisan::call('config:cache');
    Artisan::call('route:cache');
    return "Optimization Cache is set";
});
Route::get('clear', function () {
    Artisan::call('optimize:clear');
    Artisan::call('config:clear');
    Artisan::call('route:clear');
    //Artisan::call('composer:autoload');
    return "Optimization Cache is Cleared";
});

Route::get('getHomePageDetails', 'GetHomeDetailsController@getHomePageDetails');
Route::get('getAboutUsPageDetails', 'GetHomeDetailsController@getAboutUsPageDetails');
Route::get('getFacilitiesPageDetails', 'GetHomeDetailsController@getFacilitiesPageDetails');
Route::get('getContactUsPageDetails', 'GetHomeDetailsController@getContactUsPageDetails');
Route::post('contactUsCreate', 'ContactUsController@contactUsCreate');
Route::post('appointmentCreate', 'AppointmentController@appointmentCreate');

//User
Route::post('loginUser', 'UserController@loginUser');
Route::post('forgotPassword', 'UserController@forgotPassword');
Route::post('ResetPassword', 'UserController@ResetPassword');

Route::group(['middleware' => 'auth:sanctum'], function() {
    Route::post('updateImage','ImageController@imageUpload');

    //Homebanner
    Route::apiResource('HomeBanner', 'HomeBannerController');
    Route::get('HomeBannerSwitch/{id}', 'HomeBannerController@HomeBannerSwitch');
    Route::post('imageUpdateHomeBanner', 'HomeBannerController@imageUpdateHomeBanner');
    Route::get('getAllHomeBanner', 'HomeBannerController@getAllHomeBanner');

    //who are we
    Route::apiResource('whoweare', 'WhoAreWeController');
    Route::get('getWhoAreWe', 'WhoAreWeController@getWhoAreWe');
    Route::put('updateWhoAreWe', 'WhoAreWeController@updateWhoAreWe');

    //Home Page Title
    Route::apiResource('homepagetitle', 'HomePageTitleController');
    Route::get('getHomePageTitle', 'HomePageTitleController@getHomePageTitle');
    Route::put('updateHomePageTitle', 'HomePageTitleController@updateHomePageTitle');

    //Facilities
    Route::apiResource('facilities', 'FacilitiesController');
    Route::get('facilitiesSwitch/{id}', 'FacilitiesController@facilitiesSwitch');
    Route::get('getAllfacilities', 'FacilitiesController@getAllfacilities');

    //Gallery
    Route::apiResource('galleryImage', 'GalleryImageController');
    Route::get('galleryImageSwitch/{id}', 'GalleryImageController@galleryImageSwitch');
    Route::post('imageUpdateGallery', 'GalleryImageController@imageUpdateGallery');
    Route::get('getAllGalleryImage', 'GalleryImageController@getAllGalleryImage');
    Route::get('getActiveGalleryImage', 'GalleryImageController@getActiveGalleryImage');

    //Testimony
    Route::apiResource('testimony', 'TestimonyController');
    Route::get('TestimonySwitch/{id}', 'TestimonyController@TestimonySwitch');
    Route::get('getAllTestimony', 'TestimonyController@getAllTestimony');

    //Consult-Us
    Route::apiResource('consultUs', 'ConsultUsController');
    Route::get('consultUsSwitch/{id}', 'ConsultUsController@consultUsSwitch');
    Route::get('getAllConsultUs', 'ConsultUsController@getAllConsultUs');
    Route::get('getActiveConsultUs', 'ConsultUsController@getActiveConsultUs');

    //Consult-Us-Number
    Route::apiResource('consultUsNumber', 'ConsultUsNumberController');
    Route::get('consultUsNumberSwitch/{id}', 'ConsultUsNumberController@consultUsNumberSwitch');
    Route::get('getAllConsultUsNumber', 'ConsultUsNumberController@getAllConsultUsNumber');

    //AboutUs
    Route::apiResource('aboutUs', 'AboutUsController');
    Route::get('getAboutUs', 'AboutUsController@getAboutUs');
    Route::put('updateAboutUs', 'AboutUsController@updateAboutUs');

    //Statement
    Route::apiResource('statement', 'StatementController');
    Route::get('StatementSwitch/{id}', 'StatementController@StatementSwitch');
    Route::get('getAllStatement', 'StatementController@getAllStatement');

    //AdvancedTreatment
    Route::apiResource('advancedTreatment', 'AdvancedTreatmentController');
    Route::get('getAdvancedTreatment', 'AdvancedTreatmentController@getAdvancedTreatment');
    Route::put('updateAdvancedTreatment', 'AdvancedTreatmentController@updateAdvancedTreatment');

    //BestTreatment
    Route::apiResource('bestTreatment', 'BestTreatmentController');
    Route::get('bestTreatmentSwitch/{id}', 'BestTreatmentController@bestTreatmentSwitch');
    Route::post('imageUpdateBestTreatment', 'BestTreatmentController@imageUpdateBestTreatment');
    Route::get('getAllBestTreatmentDetails', 'BestTreatmentController@getAllBestTreatmentDetails');

    //ContactUs
    Route::apiResource('contactUs', 'ContactUsController');
    Route::get('getContactUsDetails', 'ContactUsController@getContactUsDetails');

    //Appointment
    Route::apiResource('appointment', 'AppointmentController');
    Route::get('getAppointmentDetails', 'AppointmentController@getAppointmentDetails');

    //Socialmedia
    Route::apiResource('socialmedia', 'SocialMediaController');
    Route::get('getSocialMedia', 'SocialMediaController@getSocialMedia');
    Route::put('updateSocialMedia', 'SocialMediaController@updateSocialMedia');

    //SEO
    Route::apiResource('seo', 'SeoController');
    Route::get('getSeoDetails/{type}', 'SeoController@getSeoDetails');
    Route::put('updateSeoDetails', 'SeoController@updateSeoDetails');

    //User
    Route::apiResource('user', 'UserController');
    Route::get('searchUser/{search}', 'UserController@searchUser');
    Route::get('userSwitch/{id}', 'UserController@userSwitch');

    //UserTypes
    Route::apiResource('userTypes', 'UserTypesController');
    Route::get('userTypesSwitch/{id}', 'UserTypesController@userTypesSwitch');
    Route::get('getAllUserTypes', 'UserTypesController@getAllUserTypes');
    Route::get('getActiveUserTypes', 'UserTypesController@getActiveUserTypes');
});
