<?php

use Illuminate\Support\Facades\Route;

/*
|--------------------------------------------------------------------------
| 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('/', function () {
    return view('welcome');
});
Route::get('/new', function () {
    return view('index');
});
// Route::get('/test', function () {
//     return view('frontend/home');
// });

Route::get('/home', [App\Http\Controllers\HomeController::class, 'index'])->name('home');



//Presentation backend
Route::get('/presentations', [App\Http\Controllers\backend\PresentationController::class, 'Index'])->name('presentations');
Route::get('/presentation/add', [App\Http\Controllers\backend\PresentationController::class, 'Create'])->name('presentation.add');
Route::post('/presentation', [App\Http\Controllers\backend\PresentationController::class, 'store'])->name('presentation');
Route::get('presentation/{id}', [App\Http\Controllers\backend\PresentationController::class, 'show']);
Route::get('presentation/{id}/edit', [App\Http\Controllers\backend\PresentationController::class, 'edit']);
Route::put('presentation/{id}', [App\Http\Controllers\backend\PresentationController::class, 'update']);
Route::get('presentations/{id}/editImage', [App\Http\Controllers\backend\PresentationController::class, 'editImage']);
Route::put('presentationsImage/{id}', [App\Http\Controllers\backend\PresentationController::class, 'updateImage']);
Route::delete("deleteImageP/{id}", [App\Http\Controllers\backend\PresentationController::class, "deleteImage"])->name("delete");

Route::get('changeStatusPresentation',  [App\Http\Controllers\backend\PresentationController::class, 'changeStatus']);

Route::delete("presentations/{id}", [App\Http\Controllers\backend\PresentationController::class, "destroyP"]);

Route::get('presentations/{id}/editDetails', [App\Http\Controllers\backend\PresentationController::class, 'editDetails']);
Route::put('presentationsDetails/{id}', [App\Http\Controllers\backend\PresentationController::class, 'updateDetails']);

Route::get('presentations/{id}/editVideo', [App\Http\Controllers\backend\PresentationController::class, 'editVideo']);
Route::put('presentationsVideo/{id}', [App\Http\Controllers\backend\PresentationController::class, 'uploadVideo']);
Route::delete("deleteVideo/{id}", [App\Http\Controllers\backend\PresentationController::class, "deleteVideo"])->name("delete");

Route::POST('/file-upload-presentation', [App\Http\Controllers\backend\PresentationController::class, 'fileUpload']);
Route::delete("/file-delete-presentation", [App\Http\Controllers\backend\PresentationController::class, "deleteUpload"]);
// Route::resource('/test', PresentationController::class);

//Slide backend
Route::get('/slides', [App\Http\Controllers\backend\SlideController::class, 'Index'])->name('slides');

Route::get('/slide/add', [App\Http\Controllers\backend\SlideController::class, 'Create'])->name('slide.add');
Route::post('/slide', [App\Http\Controllers\backend\SlideController::class, 'store'])->name('slide');
Route::get('slide/{id}', [App\Http\Controllers\backend\SlideController::class, 'show']);
Route::get('slide/{id}/edit', [App\Http\Controllers\backend\SlideController::class, 'edit']);
Route::put('slide/{id}', [App\Http\Controllers\backend\SlideController::class, 'update']);
Route::delete("slide/{id}", [App\Http\Controllers\backend\SlideController::class, "destroy"]);
Route::get('changeStatusSlide',  [App\Http\Controllers\backend\SlideController::class, 'changeStatus']);
Route::POST('/file-upload-slide', [App\Http\Controllers\backend\SlideController::class, 'fileUpload']);
Route::delete("/file-delete-slide", [App\Http\Controllers\backend\SlideController::class, "deleteUpload"]);

//category backend
Route::get('/categories', [App\Http\Controllers\backend\CategorieController::class, 'Index'])->name('categories');

Route::get('/categorie/add', [App\Http\Controllers\backend\CategorieController::class, 'Create'])->name('categorie.add');
Route::post('/categorie', [App\Http\Controllers\backend\CategorieController::class, 'store'])->name('/categorie');

Route::get('categorie/{id}', [App\Http\Controllers\backend\CategorieController::class, 'show']);

Route::get('categorie/{id}/edit', [App\Http\Controllers\backend\CategorieController::class, 'edit']);
Route::put('categorie/{id}', [App\Http\Controllers\backend\CategorieController::class, 'update']);
Route::delete("categorie/{id}", [App\Http\Controllers\backend\CategorieController::class, "destroy"]);
Route::get('changeStatusCategory',  [App\Http\Controllers\backend\CategorieController::class, 'changeStatus']);
Route::POST('/file-upload-category', [App\Http\Controllers\backend\CategorieController::class, 'fileUpload']);
Route::delete("/file-delete-category", [App\Http\Controllers\backend\CategorieController::class, "deleteUpload"]);
//produit categorie


Route::get('/produits', [App\Http\Controllers\backend\ProduitController::class, 'Index'])->name('produits');

Route::get('/produit/add', [App\Http\Controllers\backend\ProduitController::class, 'Create'])->name('produit.add');
Route::post('/produit', [App\Http\Controllers\backend\ProduitController::class, 'store'])->name('/produit');

Route::get('produit/{id}', [App\Http\Controllers\backend\ProduitController::class, 'show']);
Route::get('produit/{id}/edit', [App\Http\Controllers\backend\ProduitController::class, 'edit']);
Route::put('produit/{id}', [App\Http\Controllers\backend\ProduitController::class, 'update']);
Route::get('produit/{id}/diapo', [App\Http\Controllers\backend\ProduitController::class, 'diapo']);
Route::put('produitDiapo/{id}', [App\Http\Controllers\backend\ProduitController::class, 'updateDiapo']);
Route::delete("deleteMedia/{id}", [App\Http\Controllers\backend\ProduitController::class, "destroyMedia"])->name("delete");
Route::delete("produit/{id}", [App\Http\Controllers\backend\ProduitController::class, "destroyProduit"]);
Route::POST('/file-upload-produit', [App\Http\Controllers\backend\ProduitController::class, 'fileUploadProduit']);
Route::delete("/file-delete-produit", [App\Http\Controllers\backend\ProduitController::class, "fileDeleteProduit"]);

Route::POST('/file-upload', [App\Http\Controllers\backend\ProduitController::class, 'fileUpload']);
Route::delete("/file-delete", [App\Http\Controllers\backend\ProduitController::class, "deleteUpload"]);
Route::get('changeStatusProduit',  [App\Http\Controllers\backend\ProduitController::class, 'changeStatus']);
Route::get('changeStatusProduitHome',  [App\Http\Controllers\backend\ProduitController::class, 'homeStatus']);

Route::get('produit/{id}/editDoc', [App\Http\Controllers\backend\ProduitController::class, 'editDoc']);
Route::get('Doc/{produit}/download', [App\Http\Controllers\backend\ProduitController::class, 'downloadDoc'])->name('doc.download');
Route::get('Doc/{produit}/size', [App\Http\Controllers\backend\ProduitController::class, 'sizeDoc'])->name('doc.size');


Route::put('produitDoc/{id}', [App\Http\Controllers\backend\ProduitController::class, 'updateDoc']);

Route::POST('/doc-upload', [App\Http\Controllers\backend\ProduitController::class, 'docUpload']);
Route::delete("/doc-delete", [App\Http\Controllers\backend\ProduitController::class, "docUploadDelete"]);

// Route::get('changeStatusProduit',  [App\Http\Controllers\backend\ProduitController::class, 'changeStatus']);

 Route::get('/test', [App\Http\Controllers\frontend\HomeController::class, 'index']);
//  Route::get('/test', [App\Http\Controllers\frontend\HomeController::class, 'index']);



//promotion routes

Route::get('/promotions', [App\Http\Controllers\backend\PromotionController::class, 'Index'])->name('promotions');

Route::get('/promotion/add', [App\Http\Controllers\backend\PromotionController::class, 'Create'])->name('promotion.add');
Route::get('/promotion/pack/add', [App\Http\Controllers\backend\PromotionController::class, 'CreatePack'])->name('promotionPack.add');
Route::post('/promotion/produit', [App\Http\Controllers\backend\PromotionController::class, 'store'])->name('/promotion/produit');
Route::get('send', [App\Http\Controllers\backend\NotifyController::class, 'Index']);
// Auth::routes();

Route::get('/home', [App\Http\Controllers\HomeController::class, 'index'])->name('home');

Auth::routes();

Route::get('/home', [App\Http\Controllers\HomeController::class, 'index'])->name('home');
