fix route + clean - issue #23
This commit is contained in:
parent
0515eadc37
commit
86b765704e
26 changed files with 92 additions and 30824 deletions
|
|
@ -7,11 +7,6 @@ use App\Models\Product;
|
|||
use App\Models\Slider;
|
||||
use App\Models\Range;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Validator;
|
||||
use LDC\LDCCRM\Enums\ApiError;
|
||||
use LDC\LDCCRM\Exceptions\ApiErrorException;
|
||||
use LDC\LDCCRM\Exceptions\CrmException;
|
||||
use LDC\LDCCRM\Models\SingleOptin;
|
||||
|
||||
class HomeController extends Controller
|
||||
{
|
||||
|
|
@ -42,35 +37,4 @@ class HomeController extends Controller
|
|||
|
||||
return view('home', compact('content', 'products', 'slides', 'quickorder_ranges'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Call the CRM to add a single optin
|
||||
*
|
||||
* @param Request $request
|
||||
* @return \Illuminate\Contracts\View\View
|
||||
*
|
||||
*/
|
||||
public function addOptIn(Request $request)
|
||||
{
|
||||
$validator = Validator::make($request->all(), ['email' => 'required|email']);
|
||||
if ($validator->fails()) {
|
||||
return __('L\'adresse email est incorrecte');
|
||||
}
|
||||
|
||||
try {
|
||||
SingleOptin::setStatus($request->email, true);
|
||||
return trans('Votre inscription à la newsletter a été prise en compte');
|
||||
} catch (ApiErrorException $e) {
|
||||
// * Il y a deja un customerInfo avec optin a true pour ce customer
|
||||
if ($e->getApiError()->equals(ApiError::singleOptinCustomerExists())) {
|
||||
return trans('Vous êtes déjà inscrit avec cette adresse email');
|
||||
}
|
||||
report($e);
|
||||
return trans('Une erreur est survenue, merci de réessayer ultérieurement');
|
||||
} catch (CrmException $e) {
|
||||
report($e);
|
||||
return trans('Une erreur est survenue, merci de réessayer ultérieurement');
|
||||
}
|
||||
return trans('Une erreur est survenue, merci de réessayer ultérieurement ');
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,31 +11,6 @@ use Illuminate\Http\Request;
|
|||
|
||||
class ProductsController extends Controller
|
||||
{
|
||||
/**
|
||||
* One Range page
|
||||
*
|
||||
* @param Request $request
|
||||
* @param string $range_slug
|
||||
* @return \Illuminate\Contracts\View\View
|
||||
*
|
||||
* @phpcs:disable Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClassBeforeLastUsed
|
||||
*/
|
||||
public function range(Request $request, string $range_slug)
|
||||
{
|
||||
// @phpcs:enable
|
||||
$range = Range::where('slug', $range_slug)->first();
|
||||
if (!$range || !$range->status) {
|
||||
abort(404);
|
||||
}
|
||||
$products = Product::where('range_id', $range->id)->where('status', 1)->paginate(9);
|
||||
// Find promo within range.
|
||||
$offres = Product::where('range_id', $range->id)
|
||||
->where('status', 1)
|
||||
->has('promotions')
|
||||
->with('promotions')->get();
|
||||
return view('range', compact('range', 'products', 'offres'));
|
||||
}
|
||||
|
||||
/**
|
||||
* One product page
|
||||
*
|
||||
|
|
|
|||
4
public/basic/css/app.css
vendored
4
public/basic/css/app.css
vendored
|
|
@ -1,4 +0,0 @@
|
|||
nav ol {
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
30336
public/basic/js/app.js
vendored
30336
public/basic/js/app.js
vendored
File diff suppressed because it is too large
Load diff
|
|
@ -1,25 +0,0 @@
|
|||
@extends('layouts.layout')
|
||||
|
||||
@section('title', __('Connexion'))
|
||||
|
||||
@section('content')
|
||||
<h1>Se connecter</h1>
|
||||
@if ($errors->any())
|
||||
<div class="alert alert-danger">
|
||||
<ul>
|
||||
@foreach ($errors->all() as $error)
|
||||
<li>{{ $error }}</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
</div>
|
||||
@endif
|
||||
<br>
|
||||
<form action="{{ route('auth.login.post') }}" method="POST">
|
||||
@csrf
|
||||
<input name="email" type="email" placeholder="Email" required>
|
||||
<br>
|
||||
<input name="password" type="password" placeholder="Mot de passe" required>
|
||||
<br>
|
||||
<input type="submit" value="Connexion">
|
||||
</form>
|
||||
@endsection
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
@extends('layouts.layout')
|
||||
|
||||
@section('content')
|
||||
<h1>Se connecter</h1>
|
||||
@if ($errors->any())
|
||||
<div class="alert alert-danger">
|
||||
<ul>
|
||||
@foreach ($errors->all() as $error)
|
||||
<li>{{ $error }}</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
</div>
|
||||
@endif
|
||||
<br>
|
||||
<form action="{{ route('auth.login.post') }}" method="POST">
|
||||
@csrf
|
||||
<input name="email" type="email" placeholder="Email" required>
|
||||
<br>
|
||||
<input name="password" type="password" placeholder="Mot de passe" required>
|
||||
<br>
|
||||
<input type="submit" value="Connexion">
|
||||
</form>
|
||||
@endsection
|
||||
|
|
@ -1,37 +0,0 @@
|
|||
@extends('layouts.layout')
|
||||
|
||||
@section('content')
|
||||
<h1>Inscription</h1>
|
||||
|
||||
@if ($errors->any())
|
||||
<div class="alert alert-danger">
|
||||
<ul>
|
||||
@foreach ($errors->all() as $error)
|
||||
<li>{{ $error }}</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if (session('success'))
|
||||
<h1>{{ session('success') }}</h1>
|
||||
@else
|
||||
<form action="{{ route('auth.register.post') }}" method="POST">
|
||||
@csrf
|
||||
<input name="lastname" type="text" placeholder="Nom" required>
|
||||
<input name="firstname" type="text" placeholder="Prénom" required>
|
||||
<br>
|
||||
<label>+18 ans</label><br>
|
||||
<input name="date_of_birth" type="date" required>
|
||||
<br>
|
||||
<input name="email" type="email" placeholder="Votre adresse email" pattern="[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,4}$" required>
|
||||
<br>
|
||||
<input name="email_confirmation" type="email" placeholder="Confirmez votre adresse email" pattern="[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,4}$" required>
|
||||
<br>
|
||||
<input name="password" type="password" placeholder="Votre mot de passe" required>
|
||||
<br>
|
||||
<input type="submit" value="Valider">
|
||||
</form>
|
||||
@endif
|
||||
|
||||
@endsection
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
@extends('layouts.layout')
|
||||
|
||||
@section('content')
|
||||
<h1>Mot de passe oublié ?</h1>
|
||||
@endsection
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
@extends('layouts.layout')
|
||||
|
||||
@section('content')
|
||||
<h1>Mon panier</h1>
|
||||
@endsection
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
@extends('layouts.layout')
|
||||
|
||||
@section('content')
|
||||
<h1>Contact</h1>
|
||||
@if ($content !== null)
|
||||
{!!$content->value!!}
|
||||
@endif
|
||||
@endsection
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
@extends('layouts.layout')
|
||||
|
||||
@section('content')
|
||||
<h1>FAQ</h1><br/>
|
||||
@foreach ($faq as $f)
|
||||
<h3>{{$f->question}}</h3>
|
||||
<p>{{$f->answer}}</p>
|
||||
@endforeach
|
||||
@endsection
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
@extends('layouts.layout')
|
||||
|
||||
@section('content')
|
||||
<h1>Home</h1>
|
||||
@if ($content !== null)
|
||||
{!!$content->value!!}
|
||||
@endif
|
||||
@endsection
|
||||
7
resources/views/front/basic/js/app.js
vendored
7
resources/views/front/basic/js/app.js
vendored
|
|
@ -1,7 +0,0 @@
|
|||
//front JS for the theme
|
||||
|
||||
require('./bootstrap');
|
||||
|
||||
$(document).ready(function() {
|
||||
console.log('basic theme on');
|
||||
});
|
||||
39
resources/views/front/basic/js/bootstrap.js
vendored
39
resources/views/front/basic/js/bootstrap.js
vendored
|
|
@ -1,39 +0,0 @@
|
|||
window._ = require('lodash');
|
||||
|
||||
/**
|
||||
* We'll load jQuery.
|
||||
* This code may be modified to fit the specific needs of your application.
|
||||
*/
|
||||
|
||||
try {
|
||||
|
||||
window.$ = window.jQuery = require('jquery');
|
||||
|
||||
} catch (e) {}
|
||||
|
||||
/**
|
||||
* We'll load the axios HTTP library which allows us to easily issue requests
|
||||
* to our Laravel back-end. This library automatically handles sending the
|
||||
* CSRF token as a header based on the value of the "XSRF" token cookie.
|
||||
*/
|
||||
|
||||
window.axios = require('axios');
|
||||
|
||||
window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';
|
||||
|
||||
/**
|
||||
* Echo exposes an expressive API for subscribing to channels and listening
|
||||
* for events that are broadcast by Laravel. Echo and event broadcasting
|
||||
* allows your team to easily build robust real-time web applications.
|
||||
*/
|
||||
|
||||
// import Echo from 'laravel-echo';
|
||||
|
||||
// window.Pusher = require('pusher-js');
|
||||
|
||||
// window.Echo = new Echo({
|
||||
// broadcaster: 'pusher',
|
||||
// key: process.env.MIX_PUSHER_APP_KEY,
|
||||
// cluster: process.env.MIX_PUSHER_APP_CLUSTER,
|
||||
// forceTLS: true
|
||||
// });
|
||||
|
|
@ -1,38 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
||||
<title>@yield('title') - {{ Config::get('theme.site_name') }}</title>
|
||||
<!-- Styles -->
|
||||
<link href="{{ asset(config('app.theme').'/css/app.css') }}" rel="stylesheet">
|
||||
</head>
|
||||
<body>
|
||||
<nav>
|
||||
<ol>
|
||||
<li><a href="{{ route('home') }}">Accueil</a></li>
|
||||
<li><a href="{{ route('contact') }}">Contact</a></li>
|
||||
<li><a href="{{ route('legal-notice') }}">Mentions Légales</a></li>
|
||||
<li><a href="{{ route('terms') }}">CGV</a></li>
|
||||
<li><a href="{{ route('privacy') }}">Politique de confidentialité</a></li>
|
||||
<li><a href="{{ route('faq') }}">FAQ</a></li>
|
||||
<li>-</li>
|
||||
@auth
|
||||
<li><a href="{{ route('auth.logout') }}">Se déconnecter</a></li>
|
||||
@else
|
||||
<li><a href="{{ route('auth.login') }}">Se connecter</a></li>
|
||||
<li><a href="{{ route('auth.register') }}">Inscription</a></li>
|
||||
{{--<li><a href="{{ route('auth.reset-password') }}">Mot de passe oublié ?</a></li>--}}
|
||||
@endif
|
||||
<li>-</li>
|
||||
{{--<li><a href="{{ route('basket') }}">Mon Panier</a></li>--}}
|
||||
<li>-</li>
|
||||
<li><a href="{{ route('ranges') }}">Gammes de produits</a></li>
|
||||
</ol>
|
||||
</nav>
|
||||
@yield('content')
|
||||
<script src="{{ asset(config('app.theme').'/js/app.js') }}"></script>
|
||||
@yield('scripts')
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
@extends('layouts.layout')
|
||||
|
||||
@section('content')
|
||||
<h1>Mentions Légales</h1>
|
||||
@if ($content !== null)
|
||||
{!!$content->value!!}
|
||||
@endif
|
||||
@endsection
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
@extends('layouts.layout')
|
||||
|
||||
@section('content')
|
||||
<h1>Politique de confidentialité</h1>
|
||||
@if ($content !== null)
|
||||
{!!$content->value!!}
|
||||
@endif
|
||||
@endsection
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
@extends('layouts.layout')
|
||||
|
||||
@section('content')
|
||||
<h1>Produit "{{$product->name}}"</h1>
|
||||
@endsection
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
@extends('layouts.layout')
|
||||
|
||||
@section('content')
|
||||
<h1>Gamme de produits "{{$range->name}}"</h1>
|
||||
<ul>
|
||||
@foreach($range->products as $product)
|
||||
<li><a href="{{route('product', $product->slug)}}">{{$product->name}}</a></li>
|
||||
@endforeach
|
||||
</ul>
|
||||
@endsection
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
@extends('layouts.layout')
|
||||
|
||||
@section('content')
|
||||
<h1>Gammes de produits</h1>
|
||||
<ul>
|
||||
@foreach ($published_ranges as $range)
|
||||
<li><a href="{{ route('range', ['rangeSlug' => $range->slug]) }}">Gamme de produits - {{$range->name}}</a></li>
|
||||
@endforeach
|
||||
</ul>
|
||||
@endsection
|
||||
6
resources/views/front/basic/sass/app.scss
vendored
6
resources/views/front/basic/sass/app.scss
vendored
|
|
@ -1,6 +0,0 @@
|
|||
//Front CSS for theme
|
||||
nav {
|
||||
ol {
|
||||
list-style: none;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
@extends('layouts.layout')
|
||||
|
||||
@section('content')
|
||||
<h1>CGV</h1>
|
||||
@if ($content !== null)
|
||||
{!!$content->value!!}
|
||||
@endif
|
||||
@endsection
|
||||
|
|
@ -1,29 +0,0 @@
|
|||
<?php
|
||||
|
||||
return [
|
||||
'theme_name' => 'basic',
|
||||
'site_name' => 'Boutique Générique',
|
||||
'company' => 'LDC',
|
||||
'analytics' => '',
|
||||
'product_image_maxwidth' => '100',
|
||||
'product_image_maxheight' => '100',
|
||||
'product_image_large_maxwidth' => '100',
|
||||
'product_image_large_maxheight' => '100',
|
||||
'range_image_maxwidth' => '100',
|
||||
'range_image_maxheight' => '100',
|
||||
'range_image_large_maxwidth' => '100',
|
||||
'range_image_large_maxheight' => '100',
|
||||
'content_banner_maxwidth' => '100',
|
||||
'content_banner_maxheight' => '100',
|
||||
'slide_image_maxwidth' => '1180',
|
||||
'slide_image_maxheight' => '449',
|
||||
/**
|
||||
* attention ce paramètre est un paramètre de fonctionnement
|
||||
* (y compris du back office) et nons un paramète esthétique.
|
||||
* il est lié au moteur de la boutique et ne doit pas changer
|
||||
* (au moins jamais se reduire lors d'un changement de thème)
|
||||
*/
|
||||
'enum_product_types' => [
|
||||
'foodProduct' => 'Alimentaire',
|
||||
],
|
||||
];
|
||||
|
|
@ -83,10 +83,6 @@ Breadcrumbs::for('sales.confirm', function ($trail, $reference) {
|
|||
});
|
||||
|
||||
// Catalog.
|
||||
Breadcrumbs::for('ranges', function ($trail) {
|
||||
$trail->parent('home');
|
||||
$trail->push(__('Gammes'), route('ranges'));
|
||||
});
|
||||
Breadcrumbs::for('products', function ($trail) {
|
||||
$trail->parent('home');
|
||||
$trail->push(__('Tous les produits'), route('products'));
|
||||
|
|
@ -95,10 +91,6 @@ Breadcrumbs::for('product', function ($trail, $product) {
|
|||
$trail->parent('products');
|
||||
$trail->push($product->name, route('product', ['productSlug' => $product->slug]));
|
||||
});
|
||||
Breadcrumbs::for('search', function ($trail) {
|
||||
$trail->parent('products');
|
||||
$trail->push(__('Recherche'), route('search'));
|
||||
});
|
||||
|
||||
// Account management.
|
||||
Breadcrumbs::for('account.dashboard', function ($trail) {
|
||||
|
|
|
|||
|
|
@ -4,106 +4,99 @@ use Illuminate\Support\Facades\Route;
|
|||
// AUTH.
|
||||
use App\Http\Controllers\Auth\LoginController;
|
||||
// BO.
|
||||
use App\Http\Controllers\Bo\DashboardController;
|
||||
use App\Http\Controllers\Bo\ContentController;
|
||||
use App\Http\Controllers\Bo\FaqController;
|
||||
use App\Http\Controllers\Bo\SettingsController;
|
||||
use App\Http\Controllers\Bo\OrdersController;
|
||||
use App\Http\Controllers\Bo\CreneauxController;
|
||||
use App\Http\Controllers\Bo\DashboardController;
|
||||
use App\Http\Controllers\Bo\FaqController;
|
||||
use App\Http\Controllers\Bo\MagasinsController;
|
||||
use App\Http\Controllers\Bo\OrdersController;
|
||||
use App\Http\Controllers\Bo\ProductsController;
|
||||
use App\Http\Controllers\Bo\PromotionsController;
|
||||
use App\Http\Controllers\Bo\RangesController;
|
||||
use App\Http\Controllers\Bo\SalariesController;
|
||||
use App\Http\Controllers\Bo\SettingsController;
|
||||
use App\Http\Controllers\Bo\SlidersController;
|
||||
use App\Http\Controllers\Bo\SlidesController;
|
||||
use App\Http\Controllers\Bo\TagsController;
|
||||
use App\Http\Controllers\Bo\SalariesController;
|
||||
|
||||
/*
|
||||
* --------------------------------------------------------------------------
|
||||
* 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!
|
||||
*/
|
||||
|
||||
// Actions sur les comptes utilisateurs.
|
||||
Route::name('auth.')
|
||||
->group(
|
||||
function () {
|
||||
// Bo connect.
|
||||
Route::get('/bo/login', [LoginController::class, 'index'])->name('login')->middleware('guest');
|
||||
Route::post('/bo/login', [LoginController::class, 'login'])->name('login.post')->middleware('guest');
|
||||
Route::get('/bo/logout', [LoginController::class, 'logout'])->name('logout')->middleware('auth:web');
|
||||
}
|
||||
);
|
||||
->group(function () {
|
||||
// Bo connect.
|
||||
Route::get('/bo/login', [LoginController::class, 'index'])->name('login')
|
||||
->middleware('guest');
|
||||
Route::post('/bo/login', [LoginController::class, 'login'])->name('login.post')
|
||||
->middleware('guest');
|
||||
Route::get('/bo/logout', [LoginController::class, 'logout'])->name('logout')
|
||||
->middleware('auth:web');
|
||||
});
|
||||
|
||||
Route::namespace('App\Http\Controllers\Bo')
|
||||
->prefix('bo')
|
||||
Route::prefix('bo')
|
||||
->name('bo.')
|
||||
->middleware(['auth', 'is-admin'])
|
||||
->group(
|
||||
function () {
|
||||
Route::middleware(['is-super-admin'])
|
||||
->group(
|
||||
function () {
|
||||
// Salaries.
|
||||
Route::get('/salaries', [SalariesController::class, 'index'])->name('salaries.index');
|
||||
Route::post('/salaries/file', [SalariesController::class, 'import'])->name('salaries.file');
|
||||
}
|
||||
);
|
||||
Route::get('/', [DashboardController::class, 'index'])->name('dashboard');
|
||||
Route::match(['get', 'put'], '/content/{key}', [ContentController::class, 'manage'])->name('content');
|
||||
Route::match(['get', 'put'], '/settings', [SettingsController::class, 'manage'])->name('settings');
|
||||
Route::match(['get', 'put'], '/themesettings', [SettingsController::class, 'manageTheme'])
|
||||
->name('themesettings');
|
||||
// FAQ.
|
||||
Route::get('/faq', [FaqController::class, 'index'])->name('faq');
|
||||
Route::post('/ajax/save-faq', [FaqController::class, 'saveDatas']);
|
||||
Route::post('/ajax/delete-faq', [FaqController::class, 'destroy']);
|
||||
// Creneaux.
|
||||
Route::get('/magasins/{id}/creneaux', [CreneauxController::class, 'settings'])->name('creneaux.settings');
|
||||
Route::post('/magasins/{id}/creneaux', [CreneauxController::class, 'updateSettings'])
|
||||
->name('creneaux.settings.update');
|
||||
// Exceptions de collecte.
|
||||
Route::post('/ajax/save-creneaux-exception', [MagasinsController::class, 'saveExceptions']);
|
||||
Route::post('/ajax/delete-creneaux-exception', [MagasinsController::class, 'destroyExceptions']);
|
||||
// Recherche d'inco.
|
||||
Route::post('/ajax/check-inco-data', [ProductsController::class, 'checkIncoData']);
|
||||
Route::post('/ajax/get-inco-images', [ProductsController::class, 'getPrepareIncoImages']);
|
||||
Route::post('/ajax/set-inco-images', [ProductsController::class, 'setIncoImage']);
|
||||
// Produits.
|
||||
// Route ajoutée avant la déclaration de route resource.
|
||||
// Sinon la forme /products/{product} l'emporte lors du routage.
|
||||
Route::get('/products/starred', [ProductsController::class, 'starred'])->name('products.starred');
|
||||
Route::get('/products/create/{product_type?}', [ProductsController::class, 'create'])
|
||||
->name('products.create');
|
||||
Route::resource('products', 'ProductsController')->except(['create', 'show']);
|
||||
Route::post('/products/{product}/change-published', [ProductsController::class, 'changePublished'])
|
||||
->name('products.change-published');
|
||||
Route::get('/products/change-order/{product}/{direction}', [ProductsController::class, 'changeOrder'])
|
||||
->where('direction', 'up|down')->name('products.change-order');
|
||||
// Slides.
|
||||
Route::resource('slides', SlidesController::class)->except(['show']);
|
||||
Route::resource('sliders', SlidersController::class)->except(['show']);
|
||||
Route::resource('tags', TagsController::class)->except(['show']);
|
||||
Route::resource('promotions', PromotionsController::class)->except(['show']);
|
||||
Route::resource('magasins', MagasinsController::class)->except(['show']);
|
||||
Route::resources(['ranges' => RangesController::class]);
|
||||
Route::get('/slide/change-order/{id}/{action}', [SlidesController::class, 'changeOrder'])
|
||||
->name('slides.change-order');
|
||||
Route::get('/tag/change-order/{id}/{action}', [TagsController::class, 'changeOrder'])
|
||||
->name('tags.change-order');
|
||||
Route::get('/tag/toggle-status/{id}', [TagsController::class, 'toggleStatus'])->name('tags.toggle-status');
|
||||
Route::get('/customer-info/{id}/{mode?}', [OrdersController::class, 'getCustomerInfo'])
|
||||
->name('get-customer-info');
|
||||
Route::get('/magasin-info/{id}/{mode?}', [MagasinsController::class, 'getMagasinInfo'])
|
||||
->name('get-magasin-info');
|
||||
// Commandes.
|
||||
Route::get('/orders', [OrdersController::class, 'index'])->name('orders');
|
||||
Route::get('/orders/today', [OrdersController::class, 'today'])->name('orders.today');
|
||||
Route::get('/orders/{reference}', [OrdersController::class, 'orderDetail'])->name('order-detail');
|
||||
Route::get('/orders/{reference}/advance', [OrdersController::class, 'changeStatus'])
|
||||
->name('change-order-status');
|
||||
Route::get('/orders/{reference}/cancel', [OrdersController::class, 'cancelOrder'])->name('cancel-order');
|
||||
}
|
||||
);
|
||||
->group(function () {
|
||||
Route::middleware(['is-super-admin'])
|
||||
->group(function () {
|
||||
// Salaries.
|
||||
Route::get('/salaries', [SalariesController::class, 'index'])->name('salaries.index');
|
||||
Route::post('/salaries/file', [SalariesController::class, 'import'])
|
||||
->name('salaries.file');
|
||||
});
|
||||
Route::get('/', [DashboardController::class, 'index'])->name('dashboard');
|
||||
Route::match(['get', 'put'], '/content/{key}', [ContentController::class, 'manage'])
|
||||
->name('content');
|
||||
Route::match(['get', 'put'], '/settings', [SettingsController::class, 'manage'])->name('settings');
|
||||
Route::match(['get', 'put'], '/themesettings', [SettingsController::class, 'manageTheme'])
|
||||
->name('themesettings');
|
||||
// FAQ.
|
||||
Route::get('/faq', [FaqController::class, 'index'])->name('faq');
|
||||
Route::post('/ajax/save-faq', [FaqController::class, 'saveDatas']);
|
||||
Route::post('/ajax/delete-faq', [FaqController::class, 'destroy']);
|
||||
// Creneaux.
|
||||
Route::get('/magasins/{id}/creneaux', [CreneauxController::class, 'settings'])
|
||||
->name('creneaux.settings');
|
||||
Route::post('/magasins/{id}/creneaux', [CreneauxController::class, 'updateSettings'])
|
||||
->name('creneaux.settings.update');
|
||||
// Exceptions de collecte.
|
||||
Route::post('/ajax/save-creneaux-exception', [MagasinsController::class, 'saveExceptions']);
|
||||
Route::post('/ajax/delete-creneaux-exception', [MagasinsController::class, 'destroyExceptions']);
|
||||
// Recherche d'inco.
|
||||
Route::post('/ajax/check-inco-data', [ProductsController::class, 'checkIncoData']);
|
||||
Route::post('/ajax/get-inco-images', [ProductsController::class, 'getPrepareIncoImages']);
|
||||
Route::post('/ajax/set-inco-images', [ProductsController::class, 'setIncoImage']);
|
||||
// Produits.
|
||||
// Route ajoutée avant la déclaration de route resource.
|
||||
// Sinon la forme /products/{product} l'emporte lors du routage.
|
||||
Route::get('/products/starred', [ProductsController::class, 'starred'])->name('products.starred');
|
||||
Route::get('/products/create/{product_type?}', [ProductsController::class, 'create'])
|
||||
->name('products.create');
|
||||
Route::resource('products', ProductsController::class)->except(['create', 'show']);
|
||||
Route::post('/products/{product}/change-published', [ProductsController::class, 'changePublished'])
|
||||
->name('products.change-published');
|
||||
Route::get('/products/change-order/{product}/{direction}', [ProductsController::class, 'changeOrder'])
|
||||
->where('direction', 'up|down')->name('products.change-order');
|
||||
// Slides.
|
||||
Route::resource('slides', SlidesController::class)->except(['show']);
|
||||
Route::resource('sliders', SlidersController::class)->except(['show']);
|
||||
Route::resource('tags', TagsController::class)->except(['show']);
|
||||
Route::resource('promotions', PromotionsController::class)->except(['show']);
|
||||
Route::resource('magasins', MagasinsController::class)->except(['show']);
|
||||
Route::resources(['ranges' => RangesController::class]);
|
||||
Route::get('/slide/change-order/{id}/{action}', [SlidesController::class, 'changeOrder'])
|
||||
->name('slides.change-order');
|
||||
Route::get('/tag/change-order/{id}/{action}', [TagsController::class, 'changeOrder'])
|
||||
->name('tags.change-order');
|
||||
Route::get('/tag/toggle-status/{id}', [TagsController::class, 'toggleStatus'])
|
||||
->name('tags.toggle-status');
|
||||
Route::get('/customer-info/{id}/{mode?}', [OrdersController::class, 'getCustomerInfo'])
|
||||
->name('get-customer-info');
|
||||
Route::get('/magasin-info/{id}/{mode?}', [MagasinsController::class, 'getMagasinInfo'])
|
||||
->name('get-magasin-info');
|
||||
// Commandes.
|
||||
Route::get('/orders', [OrdersController::class, 'index'])->name('orders');
|
||||
Route::get('/orders/today', [OrdersController::class, 'today'])->name('orders.today');
|
||||
Route::get('/orders/{reference}', [OrdersController::class, 'orderDetail'])->name('order-detail');
|
||||
Route::get('/orders/{reference}/advance', [OrdersController::class, 'changeStatus'])
|
||||
->name('change-order-status');
|
||||
Route::get('/orders/{reference}/cancel', [OrdersController::class, 'cancelOrder'])
|
||||
->name('cancel-order');
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,30 +1,17 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Route;
|
||||
// FRONT.
|
||||
// FO.
|
||||
use App\Http\Controllers\IndexController;
|
||||
use App\Http\Controllers\CustomerController;
|
||||
use App\Http\Controllers\OrderTunnelController;
|
||||
// FRONT.
|
||||
use App\Http\Controllers\HomeController;
|
||||
use App\Http\Controllers\BasketController;
|
||||
use App\Http\Controllers\ProductsController;
|
||||
use App\Http\Controllers\ContactController;
|
||||
|
||||
/*
|
||||
* --------------------------------------------------------------------------
|
||||
* 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!
|
||||
*/
|
||||
|
||||
// Actions sur les comptes utilisateurs.
|
||||
Route::name('auth.')
|
||||
->group(
|
||||
function () {
|
||||
->group(function () {
|
||||
// Customer connect.
|
||||
Route::get('/connexion', [CustomerController::class, 'authenticateForm'])->name('connexion')
|
||||
->middleware('guest');
|
||||
|
|
@ -48,14 +35,12 @@ Route::name('auth.')
|
|||
// Changement en crm.
|
||||
Route::post('/reinitialiser-mdp/{token}', [CustomerController::class, 'changePassword'])
|
||||
->name('change-password');
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
Route::name('account.')
|
||||
->prefix('compte')
|
||||
->middleware('auth:customer')
|
||||
->group(
|
||||
function () {
|
||||
->prefix('compte')
|
||||
->middleware('auth:customer')
|
||||
->group(function () {
|
||||
Route::get('/profil', [CustomerController::class, 'dashboard'])->name('dashboard');
|
||||
Route::post('/profil', [CustomerController::class, 'updateInfos'])->name('update-infos');
|
||||
Route::post(
|
||||
|
|
@ -64,8 +49,7 @@ Route::name('account.')
|
|||
)->name('change-password');
|
||||
Route::get('/commandes', [CustomerController::class, 'myOrders'])->name('my-orders');
|
||||
Route::get('/commandes/{reference}', [CustomerController::class, 'orderDetail'])->name('order-detail');
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
// Tunnel de commande.
|
||||
Route::prefix('commande')
|
||||
|
|
@ -88,25 +72,13 @@ Route::get('/', [HomeController::class, 'index'])->name('home');
|
|||
Route::get('/cgv', [IndexController::class, 'terms'])->name('terms');
|
||||
Route::get('/faq', [IndexController::class, 'faq'])->name('faq');
|
||||
|
||||
// Catalogue.
|
||||
Route::get('/gammes-de-produits', [ProductsController::class, 'allProductsFiltered'])->name('ranges');
|
||||
Route::get('/gamme-de-produits/{rangeSlug}', [ProductsController::class, 'range'])->name('range')
|
||||
->middleware('redirect-slugs');
|
||||
|
||||
// Products display.
|
||||
Route::get('/produits/{filtersMenuIsOpen?}', [ProductsController::class, 'allProductsFiltered'])->name('products');
|
||||
Route::get('/recherche', [ProductsController::class, 'allProductsFiltered'])->name('search');
|
||||
|
||||
// Products filter ajax.
|
||||
Route::get('/produits/filter', [ProductsController::class, 'allProductsFiltered'])->name('products.filters');
|
||||
|
||||
// Product.
|
||||
Route::get('/produit/{productSlug}', [ProductsController::class, 'product'])->name('product')
|
||||
->middleware('redirect-slugs');
|
||||
|
||||
// Route ajax pour Single Optin.
|
||||
Route::post('/optin', [HomeController::class, 'addOptIn'])->name('add-single-optin');
|
||||
|
||||
// Contact.
|
||||
Route::get('/contactez-nous', [ContactController::class, 'contact'])->name('contact');
|
||||
Route::post('/contactez-nous', [ContactController::class, 'contactSubmit'])->name('contact-us.submit');
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue