generated from boboko/starter
cart drawer and general structure
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
use App\Http\Controllers\Checkout\CartController;
|
||||
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.
|
||||
// The checkout page itself will live here once that slice is built.
|
||||
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');
|
||||
});
|
||||
Reference in New Issue
Block a user