Ajout de redirections post MEP oubliés par Sylvain
This commit is contained in:
parent
45e298f2a9
commit
3fef79fa72
1 changed files with 55 additions and 39 deletions
|
|
@ -6,43 +6,59 @@ use App\Http\Controllers\Fo\NewsController;
|
|||
use App\Http\Controllers\Fo\StaticPageController;
|
||||
use Illuminate\Support\Facades\Route;
|
||||
|
||||
Route::middleware(['throttle:web'])
|
||||
->name('fo.')
|
||||
->group(function () {
|
||||
Route::middleware(['local-development'])->group(function () {
|
||||
Route::view('/bs-demo', 'fo.pages.bs-demo')->name('bs-demo');
|
||||
});
|
||||
|
||||
Route::get('/', [StaticPageController::class, 'homepage'])->name('homepage');
|
||||
Route::get('/explorateur-et-gastronome', [StaticPageController::class, 'explorer'])->name('explorer');
|
||||
Route::get('/nos-convictions', [StaticPageController::class, 'convictions'])->name('convictions');
|
||||
|
||||
// * RANGES
|
||||
Route::get('/gammes', [RangeController::class, 'index'])->name('ranges.index');
|
||||
Route::get('/gammes/filtered', [RangeController::class, 'rangesFiltered'])->name('ranges.filtered');
|
||||
Route::get('/gamme/{slug}', [RangeController::class, 'show'])->name('ranges.show');
|
||||
|
||||
// * PRODUCTS
|
||||
Route::get('/produits/filtered', [ProductController::class, 'productsFiltered'])->name('products.filtered');
|
||||
Route::get('/produits/{slug}', [ProductController::class, 'show'])->name('products.show');
|
||||
|
||||
// * RANGES
|
||||
Route::get('/rejoignez-nous', [StaticPageController::class, 'joinus'])->name('joinus.show');
|
||||
Route::post('/rejoignez-nous-form', [StaticPageController::class, 'joinusForm'])->name('joinus.store');
|
||||
|
||||
// * CONTACT
|
||||
Route::get('/contact', [StaticPageController::class, 'contact'])->name('contact.show');
|
||||
Route::post('/contact-form', [StaticPageController::class, 'contactForm'])
|
||||
->middleware('throttle:credentials')->name('contact.store');
|
||||
|
||||
// * LEGALS
|
||||
Route::get('/nous-connaitre', [StaticPageController::class, 'aboutUs'])->name('aboutus.show');
|
||||
|
||||
Route::get('/mentions-legales', [StaticPageController::class, 'legals'])->name('legals.show');
|
||||
Route::get('/charte-de-confidentialite', [StaticPageController::class, 'policies'])->name('policies.show');
|
||||
|
||||
// * NEWS.
|
||||
Route::get('/news', [NewsController::class, 'index'])->name('news.index');
|
||||
Route::get('/news/filtered', [NewsController::class, 'newsFiltered'])->name('news.filtered');
|
||||
Route::get('/news/{slug}', [NewsController::class, 'show'])->name('news.show');
|
||||
Route::middleware(['throttle:web'])->name('fo.')->group(function () {
|
||||
Route::middleware(['local-development'])->group(function () {
|
||||
Route::view('/bs-demo', 'fo.pages.bs-demo')->name('bs-demo');
|
||||
});
|
||||
|
||||
Route::get('/', [StaticPageController::class, 'homepage'])->name('homepage');
|
||||
Route::get('/explorateur-et-gastronome', [StaticPageController::class, 'explorer'])->name('explorer');
|
||||
Route::get('/nos-convictions', [StaticPageController::class, 'convictions'])->name('convictions');
|
||||
|
||||
// * RANGES
|
||||
Route::get('/gammes', [RangeController::class, 'index'])->name('ranges.index');
|
||||
Route::get('/gammes/filtered', [RangeController::class, 'rangesFiltered'])->name('ranges.filtered');
|
||||
Route::get('/gamme/{slug}', [RangeController::class, 'show'])->name('ranges.show');
|
||||
|
||||
// * PRODUCTS
|
||||
Route::get('/produits/filtered', [ProductController::class, 'productsFiltered'])->name('products.filtered');
|
||||
Route::get('/produits/{slug}', [ProductController::class, 'show'])->name('products.show');
|
||||
|
||||
// * RANGES
|
||||
Route::get('/rejoignez-nous', [StaticPageController::class, 'joinus'])->name('joinus.show');
|
||||
Route::post('/rejoignez-nous-form', [StaticPageController::class, 'joinusForm'])->name('joinus.store');
|
||||
|
||||
// * CONTACT
|
||||
Route::get('/contact', [StaticPageController::class, 'contact'])->name('contact.show');
|
||||
Route::post('/contact-form', [StaticPageController::class, 'contactForm'])
|
||||
->middleware('throttle:credentials')->name('contact.store');
|
||||
|
||||
// * LEGALS
|
||||
Route::get('/nous-connaitre', [StaticPageController::class, 'aboutUs'])->name('aboutus.show');
|
||||
|
||||
Route::get('/mentions-legales', [StaticPageController::class, 'legals'])->name('legals.show');
|
||||
Route::get('/charte-de-confidentialite', [StaticPageController::class, 'policies'])->name('policies.show');
|
||||
|
||||
// * NEWS.
|
||||
Route::get('/news', [NewsController::class, 'index'])->name('news.index');
|
||||
Route::get('/news/filtered', [NewsController::class, 'newsFiltered'])->name('news.filtered');
|
||||
Route::get('/news/{slug}', [NewsController::class, 'show'])->name('news.show');
|
||||
|
||||
// * Redirections suite à la MEP
|
||||
$redirections = [
|
||||
'mail/to/commercial' => 'contact',
|
||||
'rubrique/contact' => 'contact',
|
||||
'rubrique/plan-d-acces' => 'contact',
|
||||
'rubrique/service-consommateurs' => 'contact',
|
||||
'rubrique/nos-savoir-faire' => 'gammes',
|
||||
'mentions' => 'mentions-legales',
|
||||
'actualite/{any}' => 'news',
|
||||
'rubrique/nos-engagements' => 'nos-convictions',
|
||||
'rubrique/la-societe' => 'nous-connaitre',
|
||||
'rubrique/offres-d-emplois' => 'rejoignez-nous',
|
||||
];
|
||||
collect($redirections)->each(
|
||||
fn (string $newPath, string $oldPath) =>
|
||||
Route::redirect("/{$oldPath}", "/{$newPath}", 301)->name('redirect.' . str($oldPath)->slug())
|
||||
);
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue