generated from boboko/starter
product custom fields
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
use App\Http\Controllers\Checkout\CartController;
|
||||
use App\Http\Controllers\Checkout\CheckoutController;
|
||||
use App\Http\Controllers\Checkout\CustomFieldFileController;
|
||||
use Illuminate\Support\Facades\Route;
|
||||
|
||||
/*
|
||||
@@ -52,6 +53,12 @@
|
||||
->whereNumber('line')
|
||||
->name('checkout.cart.remove');
|
||||
|
||||
// A line's custom-field file (e.g. the shopper's photo) — signed,
|
||||
// temporary URLs only; see CustomFieldFileController.
|
||||
Route::get('cart/custom-field-file', CustomFieldFileController::class)
|
||||
->middleware('signed')
|
||||
->name('checkout.custom-field-file');
|
||||
|
||||
Route::post('cart/coupon', [CartController::class, 'applyCoupon'])
|
||||
->name('checkout.cart.coupon.apply');
|
||||
|
||||
|
||||
@@ -2,7 +2,12 @@
|
||||
|
||||
use Illuminate\Foundation\Inspiring;
|
||||
use Illuminate\Support\Facades\Artisan;
|
||||
use Illuminate\Support\Facades\Schedule;
|
||||
|
||||
Artisan::command('inspire', function () {
|
||||
$this->comment(Inspiring::quote());
|
||||
})->purpose('Display an inspiring quote');
|
||||
|
||||
// Deletes custom-field photo uploads (CustomFieldUploadController) older than
|
||||
// 24h that no cart or order line references — see PruneCustomFieldUploads.
|
||||
Schedule::command('custom-fields:prune-uploads')->dailyAt('04:00');
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
use App\Http\Controllers\CategoryController;
|
||||
use App\Http\Controllers\ContactController;
|
||||
use App\Http\Controllers\CustomFieldUploadController;
|
||||
use App\Http\Controllers\HomeController;
|
||||
use App\Http\Controllers\LegalPageController;
|
||||
use App\Http\Controllers\ProductController;
|
||||
@@ -33,6 +34,13 @@
|
||||
'product.stock-check',
|
||||
);
|
||||
|
||||
// Photo for a product custom field, uploaded as soon as it's picked —
|
||||
// see CustomFieldUploadController. Throttled: it writes to disk and
|
||||
// needs no cart/session to call.
|
||||
Route::post('/custom-field-uploads', [CustomFieldUploadController::class, 'store'])
|
||||
->middleware('throttle:20,1')
|
||||
->name('custom-field-upload.store');
|
||||
|
||||
Route::post('/products/{product}/reviews', [ProductController::class, 'storeReview'])->name(
|
||||
'product.reviews.store',
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user