ldc-doux/routes/web.php

174 lines
8.2 KiB
PHP
Raw Permalink Normal View History

2021-11-18 14:36:06 +01:00
<?php
/**
* Routes file
2021-12-06 08:51:51 +01:00
*
2021-11-18 14:36:06 +01:00
* @category Description
* @package Category
* @author Name <email@email.com>
* @license www.url.com MIT
* @link Tag
2021-12-01 09:01:04 +01:00
* phpcs:ignore PEAR.Commenting.FileComment.MissingVersion
2021-11-18 14:36:06 +01:00
*/
2021-12-17 17:27:25 +01:00
use App\Http\Controllers\Bo\AdviceController;
2021-12-09 17:31:10 +01:00
use App\Http\Controllers\Bo\EncartsController;
2021-12-20 17:21:09 +01:00
use App\Http\Controllers\Bo\GammesController;
2021-12-01 09:01:04 +01:00
use App\Http\Controllers\Bo\HomeController;
2022-01-30 13:57:46 +01:00
use App\Http\Controllers\Bo\MomentsController;
2021-12-13 16:55:12 +01:00
use App\Http\Controllers\Bo\PictoBrandsController;
use App\Http\Controllers\Bo\PictosController;
2021-12-17 17:27:25 +01:00
use App\Http\Controllers\Bo\PostsController;
2021-12-24 15:58:59 +01:00
use App\Http\Controllers\Bo\ProductsController;
2022-05-12 16:03:40 +02:00
use App\Http\Controllers\Bo\SeoDataController;
2021-12-06 08:51:51 +01:00
use App\Http\Controllers\Bo\SlidersController;
use App\Http\Controllers\Bo\SlidesController;
2021-12-17 17:27:25 +01:00
use App\Http\Controllers\Bo\TextsController;
2021-12-13 16:55:12 +01:00
use App\Http\Controllers\Bo\TitlesController;
2021-12-01 09:01:04 +01:00
use App\Http\Controllers\HomeController as ControllersHomeController;
2022-05-12 16:03:40 +02:00
use App\Http\Controllers\MarqueController as ControllersMarqueController;
2021-12-22 17:32:05 +01:00
use App\Http\Controllers\GammesController as ControllersGammesController;
2022-05-12 16:03:40 +02:00
use App\Http\Controllers\NewsController as ControllersNewsController;
2021-12-22 17:32:05 +01:00
use App\Http\Controllers\ProductsController as ControllersProductsController;
2022-01-25 17:43:49 +01:00
use App\Http\Controllers\ContactController as ControllersContactController;
2022-05-12 16:03:40 +02:00
use App\Http\Controllers\FoodServiceController as ControllersFoodServiceController;
use App\Http\Controllers\LegalsController as ControllersLegalsController;
use App\Http\Controllers\PolicyController as ControllersPolicyController;
2021-11-18 14:36:06 +01:00
use Illuminate\Support\Facades\Route;
2021-12-01 09:01:04 +01:00
use Illuminate\Support\Facades\Auth;
2022-05-13 12:47:18 +02:00
use Illuminate\Support\Facades\Lang;
use Illuminate\Support\Str;
2021-11-18 14:36:06 +01:00
/*
2022-08-11 12:34:27 +02:00
|--------------------------------------------------------------------------
| 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!
|
2021-11-18 14:36:06 +01:00
*/
2021-12-01 09:01:04 +01:00
Route::prefix('bo')
->name('bo.')
2022-07-18 10:36:38 +00:00
->middleware(['admin-secure'])
2021-12-01 09:01:04 +01:00
->group(
2026-10-27 09:12:51 +01:00
function (): void {
2022-07-27 14:33:56 +02:00
Auth::routes(
[
'login' => true,
'logout' => true,
'register' => false,
2022-08-11 12:34:27 +02:00
'reset' => false,
2022-08-29 17:23:10 +02:00
// For resetting passwords.
2022-08-11 12:34:27 +02:00
'confirm' => false,
2022-08-29 17:23:10 +02:00
// For additional password confirmations.
2022-08-11 12:34:27 +02:00
'verify' => false,
2022-08-29 17:23:10 +02:00
// For email verification.
2022-07-27 14:33:56 +02:00
]
);
2022-08-29 17:23:10 +02:00
Route::middleware(['auth:web', 'back-end-globals'])
2022-07-27 14:33:56 +02:00
->group(
2026-10-27 09:12:51 +01:00
function (): void {
2022-07-27 14:33:56 +02:00
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');
}
);
2021-12-01 09:01:04 +01:00
}
);
2024-03-29 12:41:10 +01:00
if (!app()->runningInConsole()) {
$langs = ['en', 'es', ''];
foreach ($langs as $lang) {
Route::middleware(['front-end-globals'])
->prefix($lang)
->name($lang == '' ? '' : $lang . '.')
->group(
2026-10-27 09:12:51 +01:00
function () use ($lang): void {
Route::get('/', [ControllersHomeController::class, 'index'])->name('home');
2022-08-29 17:23:10 +02:00
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:slug}',
[ControllersGammesController::class, 'show']
)->name('gammes.show');
Route::get(
'/' . Str::slug(Lang::get('urls.produit', [], $lang)) . '/{gammeSlug:slug}/{productSlug:slug}',
[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::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');
}
);
}//end foreach
2024-03-29 12:41:10 +01:00
}//end if