<?php


use Illuminate\Support\Facades\Route;
use Illuminate\Support\Facades\Auth;
use App\Http\Controllers\CommonController;
use App\Http\Controllers\FrequentlyAskedQuestionsController;
use App\Http\Controllers\WebPropertiesController;
use App\Http\Controllers\TeamsController;
use App\Http\Controllers\ReviewsController;
use App\Http\Controllers\AboutCompanyController; 
use App\Http\Controllers\ServicesController; 
use App\Http\Controllers\HomeController; 





/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/



Route::get('/', [App\Http\Controllers\HomeController::class, 'index'])->name('home');
Route::get('/services', [App\Http\Controllers\HomeController::class, 'services'])->name('services');
Route::get('/service-details/{id}', [App\Http\Controllers\HomeController::class, 'service_details'])->name('service-details');
Route::get('/contact-us', [App\Http\Controllers\HomeController::class, 'contact_us'])->name('contact-us');
Route::get('/about-us', [App\Http\Controllers\HomeController::class, 'about_us'])->name('about-us');

Route::post('/send-contact-message', [App\Http\Controllers\HomeController::class, 'send_contact_message'])->name('send-contact-message');


Route::get('/config-cache', function() {
    $exitCode = Artisan::call('config:cache');
    return 'Config cache cleared';
});


Route::get('/clear-cache', function() {
    $exitCode = Artisan::call('cache:clear');
    return 'Application cache cleared';
});



Auth::routes();


/// Admin Routes


Route::group(['middleware' => 'Admin'], function() {
    //Route::get('/hello', [App\Http\Controllers\HomeController::class, 'hello'])->name('home2');
    Route::get('/dashboard', [App\Http\Controllers\AdminController::class,'index'])->name('dashboard');
    Route::post('/ckeditor/upload', [CommonController::class,'upload'])->name('ckeditor.upload');
    Route::get('/change/password', [App\Http\Controllers\Auth\LoginController::class, 'changePasswordUI'])->name('changePasswordUI');
    Route::post('/change-password', [App\Http\Controllers\Auth\LoginController::class, 'changePasswordConfirm'])->name('changePasswordConfirm');
    Route::get('logout', [App\Http\Controllers\Auth\LoginController::class, 'logout'])->name('logout');

    

    // FAQ
    Route::resource('faq',FrequentlyAskedQuestionsController::class);

   
    // Website Info
    Route::resource('website-info',WebPropertiesController::class);
    Route::post('/website-info/updateData/{id}', [WebPropertiesController::class, 'updateData'])->name('webProperties.updateData');

    // Review
    Route::resource('reviews', ReviewsController::class);

    // team
    Route::resource('team', TeamsController::class);

    // About Us
    Route::resource('about-company',AboutCompanyController::class);
    Route::post('/about-company/updateData/{id}', [AboutCompanyController::class, 'updateData'])->name('about-company.updateData');
   
    // service
    Route::resource('service',ServicesController::class);
    Route::post('/service/status-change/{id}', [ServicesController::class,'statusChange'])->name('service.statusChange');


    
  
    
});



