AI store generator for ecommerce, Malaysia first. Laravel 13 + React + TypeScript.
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

web.php 4.1KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <?php
  2. use App\Http\Controllers\CartController;
  3. use App\Http\Controllers\CheckoutController;
  4. use App\Http\Controllers\OrderController;
  5. use App\Http\Controllers\ProductController;
  6. use App\Http\Controllers\StoreController;
  7. use App\Http\Controllers\StoreDesignController;
  8. use App\Http\Controllers\StoreGenerationController;
  9. use App\Http\Controllers\StripeWebhookController;
  10. use Illuminate\Support\Facades\Route;
  11. Route::inertia('/', 'welcome')->name('home');
  12. // Called by Stripe, not by a browser, so it has no login. Each message is checked with a signing secret.
  13. Route::post('stripe/webhook', StripeWebhookController::class)->name('stripe.webhook');
  14. Route::middleware(['auth', 'verified'])->group(function () {
  15. Route::get('dashboard', [StoreController::class, 'index'])->name('dashboard');
  16. Route::get('stores/create', [StoreController::class, 'create'])->name('stores.create');
  17. Route::post('stores', [StoreController::class, 'store'])->name('stores.store');
  18. Route::get('stores/{slug}', [StoreController::class, 'show'])->name('stores.show');
  19. Route::get('stores/{slug}/preview', [StoreDesignController::class, 'preview'])->name('stores.preview');
  20. Route::get('stores/{slug}/preview/shop', [StoreDesignController::class, 'shop'])->name('stores.preview.shop');
  21. Route::get('stores/{slug}/preview/products/{productSlug}', [StoreDesignController::class, 'product'])->name('stores.preview.product');
  22. Route::get('stores/{slug}/preview/cart', [CartController::class, 'show'])->name('stores.preview.cart');
  23. Route::post('stores/{slug}/preview/cart/items', [CartController::class, 'add'])->name('stores.preview.cart.add');
  24. Route::patch('stores/{slug}/preview/cart/items/{product}', [CartController::class, 'update'])->name('stores.preview.cart.update')->whereNumber('product');
  25. Route::delete('stores/{slug}/preview/cart/items/{product}', [CartController::class, 'remove'])->name('stores.preview.cart.remove')->whereNumber('product');
  26. Route::get('stores/{slug}/preview/checkout', [CheckoutController::class, 'show'])->name('stores.preview.checkout');
  27. Route::post('stores/{slug}/preview/checkout', [CheckoutController::class, 'store'])->name('stores.preview.checkout.store');
  28. Route::get('stores/{slug}/preview/orders/{publicId}', [CheckoutController::class, 'order'])->name('stores.preview.order');
  29. // Pages the merchant added, such as /about. Listed after the store's own pages so those win.
  30. Route::get('stores/{slug}/preview/{pageId}', [StoreDesignController::class, 'page'])->name('stores.preview.page')->where('pageId', '[a-z][a-z0-9-]*');
  31. Route::get('stores/{slug}/orders', [OrderController::class, 'index'])->name('stores.orders.index');
  32. Route::get('stores/{slug}/orders/{order}', [OrderController::class, 'show'])->name('stores.orders.show')->whereNumber('order');
  33. Route::get('stores/{slug}/products', [ProductController::class, 'index'])->name('stores.products.index');
  34. Route::get('stores/{slug}/products/create', [ProductController::class, 'create'])->name('stores.products.create');
  35. Route::post('stores/{slug}/products', [ProductController::class, 'store'])->name('stores.products.store');
  36. Route::get('stores/{slug}/products/{product}/edit', [ProductController::class, 'edit'])->name('stores.products.edit')->whereNumber('product');
  37. // Saving uses POST, not PUT, because browsers can only upload files with POST.
  38. Route::post('stores/{slug}/products/{product}', [ProductController::class, 'update'])->name('stores.products.update')->whereNumber('product');
  39. Route::delete('stores/{slug}/products/{product}', [ProductController::class, 'destroy'])->name('stores.products.destroy')->whereNumber('product');
  40. Route::delete('stores/{slug}/products/{product}/images/{image}', [ProductController::class, 'destroyImage'])->name('stores.products.images.destroy')->whereNumber(['product', 'image']);
  41. Route::post('stores/{slug}/generate', [StoreGenerationController::class, 'generate'])->name('stores.generate');
  42. Route::post('stores/{slug}/edits', [StoreGenerationController::class, 'edit'])->name('stores.edits');
  43. });
  44. require __DIR__.'/settings.php';