2026-09-04 19:39:37 +03:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
use App\Http\Controllers\Checkout\CartController;
|
2026-09-08 20:41:49 +03:00
|
|
|
use App\Http\Controllers\Checkout\CheckoutController;
|
2026-09-04 19:39:37 +03:00
|
|
|
use Illuminate\Support\Facades\Route;
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Cart + checkout module routes.
|
|
|
|
|
*
|
|
|
|
|
* The {locale} prefix and `locale` middleware mirror the 3dealer host's
|
|
|
|
|
* localization convention (CLAUDE.md » Localization). When this module moves to
|
|
|
|
|
* boboko-core the route definitions travel with it, but each host wraps them in
|
|
|
|
|
* whatever prefix/middleware it uses. Every action still declares $locale as its
|
|
|
|
|
* first parameter regardless, per the ControllerDispatcher positional-args
|
|
|
|
|
* gotcha documented in CLAUDE.md.
|
|
|
|
|
*
|
|
|
|
|
* Loaded from CheckoutModuleServiceProvider inside the `web` middleware group.
|
|
|
|
|
*/
|
|
|
|
|
Route::prefix('{locale}')
|
|
|
|
|
->middleware('locale')
|
|
|
|
|
->group(function () {
|
|
|
|
|
// No standalone cart page — the drawer (checkout::drawer) is the cart.
|
2026-09-08 20:41:49 +03:00
|
|
|
Route::get('checkout', [CheckoutController::class, 'show'])
|
|
|
|
|
->name('checkout.show');
|
|
|
|
|
|
|
|
|
|
Route::post('checkout/address', [CheckoutController::class, 'saveAddress'])
|
|
|
|
|
->name('checkout.address.save');
|
|
|
|
|
|
|
|
|
|
Route::post('checkout/shipping-option', [CheckoutController::class, 'selectShippingOption'])
|
|
|
|
|
->name('checkout.shipping-option.select');
|
|
|
|
|
|
2026-09-09 19:16:20 +03:00
|
|
|
Route::post('checkout/payment-method', [CheckoutController::class, 'selectPaymentMethod'])
|
|
|
|
|
->name('checkout.payment-method.select');
|
|
|
|
|
|
|
|
|
|
Route::post('checkout/place-order', [CheckoutController::class, 'placeOrder'])
|
|
|
|
|
->name('checkout.place-order');
|
|
|
|
|
|
|
|
|
|
Route::get('checkout/order-status', [CheckoutController::class, 'orderStatus'])
|
|
|
|
|
->name('checkout.order-status');
|
|
|
|
|
|
|
|
|
|
Route::get('checkout/confirmation', [CheckoutController::class, 'confirmation'])
|
|
|
|
|
->name('checkout.confirmation');
|
|
|
|
|
|
2026-09-04 19:39:37 +03:00
|
|
|
Route::post('cart/lines', [CartController::class, 'add'])
|
|
|
|
|
->name('checkout.cart.add');
|
|
|
|
|
|
|
|
|
|
Route::patch('cart/lines/{line}', [CartController::class, 'updateLine'])
|
|
|
|
|
->whereNumber('line')
|
|
|
|
|
->name('checkout.cart.update');
|
|
|
|
|
|
|
|
|
|
Route::delete('cart/lines/{line}', [CartController::class, 'remove'])
|
|
|
|
|
->whereNumber('line')
|
|
|
|
|
->name('checkout.cart.remove');
|
|
|
|
|
|
|
|
|
|
Route::post('cart/coupon', [CartController::class, 'applyCoupon'])
|
|
|
|
|
->name('checkout.cart.coupon.apply');
|
|
|
|
|
|
|
|
|
|
Route::delete('cart/coupon', [CartController::class, 'removeCoupon'])
|
|
|
|
|
->name('checkout.cart.coupon.remove');
|
|
|
|
|
});
|