File "web.php"

Full Path: /home/tecassol/public_html/tecas-solar.ma/routes/web.php
File size: 3.75 KB
MIME-type: text/x-php
Charset: utf-8

<?php

declare(strict_types=1);

use App\Http\Controllers\BlogController;
use App\Http\Controllers\ServiceController;
use Illuminate\Support\Facades\Route;
use \App\Http\Controllers\ShopController;
use \App\Http\Controllers\CategoryController;

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

// route for view tecas
Route::view('/acceuil', 'acceuil.index')->name('acceuil.index');
Route::view('/a-propos', 'a-propos.index')->name('a-propos.index');

// Route::view('/details-categories', 'details-categories.index')->name('details-categories.index');

//route Apropos
Route::prefix('/a-propos')->group(function () {
    Route::get('/', [\App\Http\Controllers\AproposController::class, 'index'])
        ->name('a-propos.index');
});

// route Insttaltion
Route::prefix('/installations')->group(function () {
    Route::get('/', [\App\Http\Controllers\InstallationController::class, 'index'])->name('installation.index');
});

// Route Contact
//Route::prefix('contacts')->group(function () {
//    Route::get('/', [\App\Http\Controllers\contactezController::class, 'index'])
//        ->name('contact.index');
//});

// Route service
Route::prefix('/services')->group(function () {
    // Route for projectSectors
    Route::get('/',
        [ServiceController::class, 'index'])
        // Route FOR project of sectors
        ->name('services-energie.index');
    Route::get('{slug}',
        [ServiceController::class, 'show'])
        ->name('services-energie.show');

});

// Route politique-de-garantie
Route::prefix('/politique-de-garantie')->group(function () {
    Route::get('/', [\App\Http\Controllers\PolitiqueController::class, 'index'])->name('politique-de-garantie.index');
});

// Route notre boutique
Route::prefix('boutique')->group(callback: function () {
    // Show all categories
    Route::get('/', [ShopController::class, 'index'])->name('shop.index');
    // Show all products in a specific category
    // Route::get('/{category:slug}', [CategoryController::class, 'show'])->name('category.details');
    // Show a single product
    Route::get('/{category:slug}/{product:slug}', [ShopController::class, 'show'])->name('shop.show');
});

// Route Blog
Route::prefix('blog')->group(callback: function () {
    Route::get('/', [BlogController::class, 'index'])->name('blogs.index');
    Route::get('/{articleCategory:slug}', [BlogController::class, 'show'])->name('blogs.show');
    Route::get('/{articleCategory:slug}/{article:slug}', [BlogController::class, 'articleShow'])->name('articles.show');
});

// Route Project
Route::prefix('etudes-de-cas')->group(callback: function () {
    Route::get('/', [\App\Http\Controllers\ProjectController::class, 'index'])->name('portfolio.index');
    Route::get('/{project:slug?}', [\App\Http\Controllers\ProjectController::class, 'show'])->name('portfolio.show');
});

Route::get('/consultation', function () {
    return view('contact.index');
})->name('consultation.index');

Route::get('/checkout', \App\Livewire\Checkout::class)->name('checkout');

// redirects for old URLs
// Static pages
Route::get('/temoignages', function () {
    return redirect()->route('home');
});
Route::get('/produit-dappel', function () {
    return redirect()->route('home');
});

Route::get('/artisan/{command}', function ($command) {
    if (!auth()->check())
        die('You must be logged in to run Artisan commands');

    if (in_array($command,
        ['migrate:fresh', 'migrate:fresh --seed', 'migrate:refresh', 'migrate:rollback', 'migrate:fresh --seed --force', 'migrate:refresh --force', 'migrate:rollback --force'])
    ) {
        die('This command is not allowed here');
    }

    \Illuminate\Support\Facades\Artisan::call($command);

    dump(\Illuminate\Support\Facades\Artisan::output());
});

include_once "redirects.php";