name('home'); // Called by Stripe, not by a browser, so it has no login. Each message is checked with a signing secret. Route::post('stripe/webhook', StripeWebhookController::class)->name('stripe.webhook'); Route::middleware(['auth', 'verified'])->group(function () { Route::get('dashboard', [StoreController::class, 'index'])->name('dashboard'); Route::get('stores/create', [StoreController::class, 'create'])->name('stores.create'); Route::post('stores', [StoreController::class, 'store'])->name('stores.store'); Route::get('stores/{slug}', [StoreController::class, 'show'])->name('stores.show'); Route::get('stores/{slug}/preview', [StoreDesignController::class, 'preview'])->name('stores.preview'); Route::get('stores/{slug}/preview/shop', [StoreDesignController::class, 'shop'])->name('stores.preview.shop'); Route::get('stores/{slug}/preview/products/{productSlug}', [StoreDesignController::class, 'product'])->name('stores.preview.product'); Route::get('stores/{slug}/preview/cart', [CartController::class, 'show'])->name('stores.preview.cart'); Route::post('stores/{slug}/preview/cart/items', [CartController::class, 'add'])->name('stores.preview.cart.add'); Route::patch('stores/{slug}/preview/cart/items/{product}', [CartController::class, 'update'])->name('stores.preview.cart.update')->whereNumber('product'); Route::delete('stores/{slug}/preview/cart/items/{product}', [CartController::class, 'remove'])->name('stores.preview.cart.remove')->whereNumber('product'); Route::get('stores/{slug}/preview/checkout', [CheckoutController::class, 'show'])->name('stores.preview.checkout'); Route::post('stores/{slug}/preview/checkout', [CheckoutController::class, 'store'])->name('stores.preview.checkout.store'); Route::get('stores/{slug}/preview/orders/{publicId}', [CheckoutController::class, 'order'])->name('stores.preview.order'); // Pages the merchant added, such as /about. Listed after the store's own pages so those win. Route::get('stores/{slug}/preview/{pageId}', [StoreDesignController::class, 'page'])->name('stores.preview.page')->where('pageId', '[a-z][a-z0-9-]*'); Route::get('stores/{slug}/orders', [OrderController::class, 'index'])->name('stores.orders.index'); Route::get('stores/{slug}/orders/{order}', [OrderController::class, 'show'])->name('stores.orders.show')->whereNumber('order'); Route::get('stores/{slug}/products', [ProductController::class, 'index'])->name('stores.products.index'); Route::get('stores/{slug}/products/create', [ProductController::class, 'create'])->name('stores.products.create'); Route::post('stores/{slug}/products', [ProductController::class, 'store'])->name('stores.products.store'); Route::get('stores/{slug}/products/{product}/edit', [ProductController::class, 'edit'])->name('stores.products.edit')->whereNumber('product'); // Saving uses POST, not PUT, because browsers can only upload files with POST. Route::post('stores/{slug}/products/{product}', [ProductController::class, 'update'])->name('stores.products.update')->whereNumber('product'); Route::delete('stores/{slug}/products/{product}', [ProductController::class, 'destroy'])->name('stores.products.destroy')->whereNumber('product'); Route::delete('stores/{slug}/products/{product}/images/{image}', [ProductController::class, 'destroyImage'])->name('stores.products.images.destroy')->whereNumber(['product', 'image']); Route::post('stores/{slug}/generate', [StoreGenerationController::class, 'generate'])->name('stores.generate'); Route::post('stores/{slug}/edits', [StoreGenerationController::class, 'edit'])->name('stores.edits'); }); require __DIR__.'/settings.php';