141 lines
7.2 KiB
PHP
141 lines
7.2 KiB
PHP
<?php
|
|
|
|
/**
|
|
* Routes file
|
|
*
|
|
* @category Description
|
|
* @package Category
|
|
* @author Name <email@email.com>
|
|
* @license www.url.com MIT
|
|
* @link Tag
|
|
* phpcs:ignore PEAR.Commenting.FileComment.MissingVersion
|
|
*/
|
|
|
|
use App\Http\Controllers\Bo\AdviceController;
|
|
use App\Http\Controllers\Bo\EncartsController;
|
|
use App\Http\Controllers\Bo\GammesController;
|
|
use App\Http\Controllers\Bo\HomeController;
|
|
use App\Http\Controllers\Bo\MomentsController;
|
|
use App\Http\Controllers\Bo\PictoBrandsController;
|
|
use App\Http\Controllers\Bo\PictosController;
|
|
use App\Http\Controllers\Bo\PostsController;
|
|
use App\Http\Controllers\Bo\ProductsController;
|
|
use App\Http\Controllers\Bo\SeoDataController;
|
|
use App\Http\Controllers\Bo\SlidersController;
|
|
use App\Http\Controllers\Bo\SlidesController;
|
|
use App\Http\Controllers\Bo\TextsController;
|
|
use App\Http\Controllers\Bo\TitlesController;
|
|
use App\Http\Controllers\HomeController as ControllersHomeController;
|
|
use App\Http\Controllers\MarqueController as ControllersMarqueController;
|
|
use App\Http\Controllers\GammesController as ControllersGammesController;
|
|
use App\Http\Controllers\NewsController as ControllersNewsController;
|
|
use App\Http\Controllers\ProductsController as ControllersProductsController;
|
|
use App\Http\Controllers\ContactController as ControllersContactController;
|
|
use App\Http\Controllers\FoodServiceController as ControllersFoodServiceController;
|
|
use App\Http\Controllers\LegalsController as ControllersLegalsController;
|
|
use App\Http\Controllers\PolicyController as ControllersPolicyController;
|
|
use Illuminate\Support\Facades\Route;
|
|
use Illuminate\Support\Facades\Auth;
|
|
use Illuminate\Support\Facades\Lang;
|
|
use Illuminate\Support\Str;
|
|
|
|
/*
|
|
|--------------------------------------------------------------------------
|
|
| 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::prefix('bo')
|
|
->name('bo.')
|
|
->middleware(['admin-secure'])
|
|
->group(
|
|
function () {
|
|
Auth::routes(
|
|
[
|
|
'login' => true,
|
|
'logout' => true,
|
|
'register' => false,
|
|
'reset' => false, // for resetting passwords
|
|
'confirm' => false, // for additional password confirmations
|
|
'verify' => false, // for email verification
|
|
]
|
|
);
|
|
Route::middleware(['auth:web', 'back-end-globals', 'lang-check'])
|
|
->group(
|
|
function () {
|
|
Route::get(
|
|
'/',
|
|
[
|
|
HomeController::class,
|
|
'home'
|
|
]
|
|
)->name('home');
|
|
Route::resources(
|
|
[
|
|
'sliders' => SlidersController::class,
|
|
'slides' => SlidesController::class,
|
|
]
|
|
);
|
|
Route::resource('seo_data', SeoDataController::class)
|
|
->except(['index', 'create', 'store', 'destroy', 'show']);
|
|
Route::resource('moments', MomentsController::class)
|
|
->except(['create', 'store', 'destroy', 'show']);
|
|
Route::resource('encarts', EncartsController::class)
|
|
->except(['index', 'create', 'store', 'destroy', 'show']);
|
|
Route::resource('pictos', PictosController::class)->except(['show']);
|
|
Route::resource('posts', PostsController::class)->except(['show']);
|
|
Route::resource('pictobrands', PictoBrandsController::class)->except(['show']);
|
|
Route::resource('gammes', GammesController::class)->except(['show']);
|
|
Route::resource('products', ProductsController::class)->except(['show']);
|
|
Route::resource('advice', AdviceController::class)
|
|
->except(['index', 'create', 'store', 'destroy', 'show']);
|
|
Route::resource('texts', TextsController::class)->except(['show']);
|
|
Route::resource('titles', TitlesController::class)
|
|
->except(['index', 'create', 'store', 'destroy', 'show']);
|
|
Route::get(
|
|
'/slide/change-order/{slide}/{action}',
|
|
[
|
|
SlidesController::class,
|
|
'changeOrder'
|
|
]
|
|
)->name('slides.change-order');
|
|
Route::get('/pictos/{page}', [PictosController::class, 'index'])->name('pictos.content');
|
|
Route::get('/texts/{page}', [TextsController::class, 'index'])->name('texts.content');
|
|
}
|
|
);
|
|
}
|
|
);
|
|
|
|
$langs = ['en', 'es', ''];
|
|
|
|
foreach ($langs as $lang) {
|
|
Route::middleware(['front-end-globals', 'lang-check'])
|
|
->prefix($lang)
|
|
->name($lang == '' ? '' : $lang . '.')
|
|
->group(
|
|
function () use ($lang) {
|
|
Route::get('/', [ControllersHomeController::class, 'index'])->name('home');
|
|
Route::get('/'.Str::slug(Lang::get('urls.marque',[], $lang)), [ControllersMarqueController::class, 'index'])->name('wasup');
|
|
Route::get('/'.Str::slug(Lang::get('urls.gammes',[], $lang)), [ControllersGammesController::class, 'index'])->name('gammes.index');
|
|
Route::get('/'.Str::slug(Lang::get('urls.gamme',[], $lang)).'/{gammeSlug}', [ControllersGammesController::class, 'show'])->name('gammes.show');
|
|
Route::get(
|
|
'/'.Str::slug(Lang::get('urls.produit',[], $lang)).'/{gammeSlug}/{productSlug}',
|
|
[ControllersProductsController::class, 'show']
|
|
)->name('product.show');
|
|
Route::get('/'.Str::slug(Lang::get('urls.news',[], $lang)), [ControllersNewsController::class, 'index'])->name('news');
|
|
Route::get('/'.Str::slug(Lang::get('urls.food-service',[], $lang)), [ControllersFoodServiceController::class, 'index'])->name('food');
|
|
Route::get('/'.Str::slug(Lang::get('urls.legals',[], $lang)), [ControllersLegalsController::class, 'index'])->name('cgu');
|
|
Route::get('/'.Str::slug(Lang::get('urls.policy',[], $lang)), [ControllersPolicyController::class, 'index'])->name('policy');
|
|
//Route::view('/plan-site', 'front.site-map')->name('site-map');
|
|
Route::get('/'.Str::slug(Lang::get('urls.search',[], $lang)), [ControllersProductsController::class, 'search'])->name('search');
|
|
//Classic
|
|
Route::get('/'.Str::slug(Lang::get('urls.contact',[], $lang)), [ControllersContactController::class, 'contact'])->name('contact');
|
|
Route::post('/contact', [ControllersContactController::class, 'contactSubmit'])->name('contact.submit');
|
|
}
|
|
);
|
|
}
|