<?php

use App\Http\Controllers\CartController;
use App\Http\Controllers\ContactController;
use App\Http\Controllers\FaqController;
use App\Http\Controllers\IndexController;
use App\Http\Controllers\NewsController;
use App\Http\Controllers\RecrutementController;
use App\Http\Controllers\RestaurantController;
use Illuminate\Support\Facades\Route;
use TCG\Voyager\Facades\Voyager;

/*
|--------------------------------------------------------------------------
| 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('/', [IndexController::class ,'index'])->name('home');

// newsletter
Route::get('/news',[NewsController::class ,'index'])->name('news');

Route::get('/services', function () {
    return view('frontend.static.services-livraison');
})->name('staticpage.static.services-livraison');

Route::get('/histoire', function () {
    return view('frontend.static.histoire');
})->name('staticpage.static.histoire');

Route::get('/engagement', function () {
    return view('frontend.static.engagement');
})->name('staticpage.static.engagement');


// Recrutment
Route::get('/recrutement', function () {
    return view('frontend.recrutement.index');
})->name('staticpage.recrutement');
Route::post('/recrutement/message',[RecrutementController::class, 'index'])->name('staticpage.recrutement.message');

// Rontact routes 

Route::get('/contact/{slug?}', function ($slug = 'contact') {
    return view('frontend.contact.index',['slug'=>$slug]);
})->name('staticpage.contact');

Route::post('/contact', [ContactController::class , 'contact'])->name('staticpage.message');

// Cart routs

Route::get('/cart', [ CartController::class,'index' ])->name('cart');
Route::get('/cart/{pCategory}/{category}', [ CartController::class,'category' ])->name('cart.produit');

// FAQ
Route::get('/faq',[FaqController::class , 'index'])->name('frontend.faq.index');


Route::get('/restaurant', [RestaurantController::class , 'index'])->name('frontend.restaurant.index');



Route::group(['prefix' => 'admin'], function () {
    Voyager::routes();
});
