@fleetbase/storefront-engine 0.1.7 → 0.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.php-cs-fixer.php +29 -0
- package/LICENSE.md +16 -4
- package/README.md +106 -13
- package/app/adapters/addon-category.js +1 -1
- package/app/adapters/gateway.js +1 -1
- package/app/adapters/network.js +1 -1
- package/app/adapters/notification-channel.js +1 -1
- package/app/adapters/product-addon-category.js +1 -1
- package/app/adapters/product-addon.js +1 -1
- package/app/adapters/product-hour.js +1 -1
- package/app/adapters/product-store-location.js +1 -1
- package/app/adapters/product-variant-option.js +1 -1
- package/app/adapters/product-variant.js +1 -1
- package/app/adapters/product.js +1 -1
- package/app/adapters/store-hour.js +1 -1
- package/app/adapters/store-location.js +1 -1
- package/app/adapters/store.js +1 -1
- package/app/adapters/storefront.js +1 -1
- package/app/components/file-record.js +1 -1
- package/app/components/modals/add-store-hours.js +1 -1
- package/app/components/modals/add-store-to-category.js +1 -1
- package/app/components/modals/add-stores-to-network.js +1 -1
- package/app/components/modals/assign-driver.js +1 -1
- package/app/components/modals/create-first-store.js +1 -1
- package/app/components/modals/create-gateway.js +1 -1
- package/app/components/modals/create-network-category.js +1 -1
- package/app/components/modals/create-network.js +1 -1
- package/app/components/modals/create-new-variant.js +1 -1
- package/app/components/modals/create-notification-channel.js +1 -1
- package/app/components/modals/create-product-category.js +1 -1
- package/app/components/modals/create-store.js +1 -1
- package/app/components/modals/edit-network.js +1 -1
- package/app/components/modals/import-products.js +1 -1
- package/app/components/modals/incoming-order.js +1 -1
- package/app/components/modals/manage-addons.js +1 -1
- package/app/components/modals/order-ready-assign-driver.js +1 -1
- package/app/components/modals/select-addon-category.js +1 -1
- package/app/components/modals/share-network.js +1 -1
- package/app/components/modals/store-details.js +1 -1
- package/app/components/modals/store-form.js +1 -1
- package/app/components/modals/store-location-form.js +1 -1
- package/app/components/network-category-picker.js +1 -1
- package/app/components/order-card.js +1 -1
- package/app/components/schedule-manager.js +1 -1
- package/app/components/settings-container.js +1 -1
- package/app/components/store-selector.js +1 -1
- package/app/components/widget/customers.js +1 -1
- package/app/components/widget/orders.js +1 -1
- package/app/components/widget/storefront-metrics.js +1 -1
- package/app/controllers/application.js +1 -1
- package/app/controllers/customers/index.js +1 -1
- package/app/controllers/home.js +1 -1
- package/app/controllers/networks/index/network/customers.js +1 -1
- package/app/controllers/networks/index/network/index.js +1 -1
- package/app/controllers/networks/index/network/orders.js +1 -1
- package/app/controllers/networks/index/network/stores.js +1 -1
- package/app/controllers/networks/index/network.js +1 -1
- package/app/controllers/networks/index.js +1 -1
- package/app/controllers/orders/index.js +1 -1
- package/app/controllers/products/index/category/edit.js +1 -1
- package/app/controllers/products/index/category/new.js +1 -1
- package/app/controllers/products/index/category.js +1 -1
- package/app/controllers/products/index/index/edit.js +1 -1
- package/app/controllers/products/index/index.js +1 -1
- package/app/controllers/products/index.js +1 -1
- package/app/controllers/settings/api.js +1 -1
- package/app/controllers/settings/gateways.js +1 -1
- package/app/controllers/settings/index.js +1 -1
- package/app/controllers/settings/locations.js +1 -1
- package/app/controllers/settings/notifications.js +1 -1
- package/app/helpers/get-tip-amount.js +1 -1
- package/app/models/addon-category.js +1 -1
- package/app/models/gateway.js +1 -1
- package/app/models/network.js +1 -1
- package/app/models/notification-channel.js +1 -1
- package/app/models/product-addon-category.js +1 -1
- package/app/models/product-addon.js +1 -1
- package/app/models/product-hour.js +1 -1
- package/app/models/product-store-location.js +1 -1
- package/app/models/product-variant-option.js +1 -1
- package/app/models/product-variant.js +1 -1
- package/app/models/product.js +1 -1
- package/app/models/store-hour.js +1 -1
- package/app/models/store-location.js +1 -1
- package/app/models/store.js +1 -1
- package/app/routes/application.js +1 -1
- package/app/routes/customers/index/edit.js +1 -1
- package/app/routes/customers/index.js +1 -1
- package/app/routes/home.js +1 -1
- package/app/routes/networks/index/network/customers.js +1 -1
- package/app/routes/networks/index/network/index.js +1 -1
- package/app/routes/networks/index/network/orders.js +1 -1
- package/app/routes/networks/index/network/stores.js +1 -1
- package/app/routes/networks/index/network.js +1 -1
- package/app/routes/networks/index.js +1 -1
- package/app/routes/orders/index/edit.js +1 -1
- package/app/routes/orders/index/new.js +1 -1
- package/app/routes/orders/index/view.js +1 -1
- package/app/routes/orders/index.js +1 -1
- package/app/routes/products/index/category/edit.js +1 -1
- package/app/routes/products/index/category/new.js +1 -1
- package/app/routes/products/index/category.js +1 -1
- package/app/routes/products/index/index/edit.js +1 -1
- package/app/routes/products/index/index.js +1 -1
- package/app/routes/products/index.js +1 -1
- package/app/routes/settings/api.js +1 -1
- package/app/routes/settings/gateways.js +1 -1
- package/app/routes/settings/index.js +1 -1
- package/app/routes/settings/locations.js +1 -1
- package/app/routes/settings/notifications.js +1 -1
- package/app/serializers/addon-category.js +1 -1
- package/app/serializers/network.js +1 -1
- package/app/serializers/notification-channel.js +1 -1
- package/app/serializers/product-addon-category.js +1 -1
- package/app/serializers/product-variant.js +1 -1
- package/app/serializers/product.js +1 -1
- package/app/serializers/store-location.js +1 -1
- package/app/serializers/store.js +1 -1
- package/app/services/storefront.js +1 -1
- package/app/templates/customers/index/edit.js +1 -1
- package/app/templates/customers/index.js +1 -1
- package/app/templates/home.js +1 -1
- package/app/templates/networks/index/network/customers.js +1 -1
- package/app/templates/networks/index/network/index.js +1 -1
- package/app/templates/networks/index/network/orders.js +1 -1
- package/app/templates/networks/index/network/stores.js +1 -1
- package/app/templates/networks/index/network.js +1 -1
- package/app/templates/networks/index.js +1 -1
- package/app/templates/orders/index/edit.js +1 -1
- package/app/templates/orders/index/new.js +1 -1
- package/app/templates/orders/index/view.js +1 -1
- package/app/templates/orders/index.js +1 -1
- package/app/templates/products/index/category/edit.js +1 -1
- package/app/templates/products/index/category/new.js +1 -1
- package/app/templates/products/index/category.js +1 -1
- package/app/templates/products/index/index/edit.js +1 -1
- package/app/templates/products/index/index.js +1 -1
- package/app/templates/products/index.js +1 -1
- package/app/templates/settings/api.js +1 -1
- package/app/templates/settings/gateways.js +1 -1
- package/app/templates/settings/index.js +1 -1
- package/app/templates/settings/locations.js +1 -1
- package/app/templates/settings/notifications.js +1 -1
- package/app/templates/settings.js +1 -1
- package/app/utils/create-shareable-link.js +1 -1
- package/app/utils/get-gateway-schemas.js +1 -1
- package/app/utils/get-notification-schemas.js +1 -1
- package/composer.json +88 -0
- package/extension.json +10 -0
- package/package.json +6 -6
- package/phpstan.neon.dist +8 -0
- package/phpunit.xml.dist +16 -0
- package/server/.gitattributes +14 -0
- package/server/README.md +40 -0
- package/server/config/api.php +101 -0
- package/server/config/database.connections.php +57 -0
- package/server/config/storefront.php +19 -0
- package/server/config/twilio-notification-channel.php +36 -0
- package/server/migrations/2023_05_03_025307_create_carts_table.php +44 -0
- package/server/migrations/2023_05_03_025307_create_checkouts_table.php +51 -0
- package/server/migrations/2023_05_03_025307_create_gateways_table.php +48 -0
- package/server/migrations/2023_05_03_025307_create_network_stores_table.php +36 -0
- package/server/migrations/2023_05_03_025307_create_networks_table.php +56 -0
- package/server/migrations/2023_05_03_025307_create_notification_channels_table.php +43 -0
- package/server/migrations/2023_05_03_025307_create_payment_methods_table.php +44 -0
- package/server/migrations/2023_05_03_025307_create_product_addon_categories_table.php +38 -0
- package/server/migrations/2023_05_03_025307_create_product_addons_table.php +43 -0
- package/server/migrations/2023_05_03_025307_create_product_hours_table.php +37 -0
- package/server/migrations/2023_05_03_025307_create_product_store_locations_table.php +34 -0
- package/server/migrations/2023_05_03_025307_create_product_variant_options_table.php +40 -0
- package/server/migrations/2023_05_03_025307_create_product_variants_table.php +44 -0
- package/server/migrations/2023_05_03_025307_create_products_table.php +59 -0
- package/server/migrations/2023_05_03_025307_create_reviews_table.php +41 -0
- package/server/migrations/2023_05_03_025307_create_store_hours_table.php +37 -0
- package/server/migrations/2023_05_03_025307_create_store_locations_table.php +38 -0
- package/server/migrations/2023_05_03_025307_create_stores_table.php +57 -0
- package/server/migrations/2023_05_03_025307_create_votes_table.php +39 -0
- package/server/migrations/2023_05_03_025310_add_foreign_keys_to_carts_table.php +40 -0
- package/server/migrations/2023_05_03_025310_add_foreign_keys_to_checkouts_table.php +48 -0
- package/server/migrations/2023_05_03_025310_add_foreign_keys_to_gateways_table.php +40 -0
- package/server/migrations/2023_05_03_025310_add_foreign_keys_to_network_stores_table.php +40 -0
- package/server/migrations/2023_05_03_025310_add_foreign_keys_to_networks_table.php +42 -0
- package/server/migrations/2023_05_03_025310_add_foreign_keys_to_notification_channels_table.php +40 -0
- package/server/migrations/2023_05_03_025310_add_foreign_keys_to_payment_methods_table.php +40 -0
- package/server/migrations/2023_05_03_025310_add_foreign_keys_to_product_addon_categories_table.php +38 -0
- package/server/migrations/2023_05_03_025310_add_foreign_keys_to_product_addons_table.php +38 -0
- package/server/migrations/2023_05_03_025310_add_foreign_keys_to_product_hours_table.php +32 -0
- package/server/migrations/2023_05_03_025310_add_foreign_keys_to_product_store_locations_table.php +34 -0
- package/server/migrations/2023_05_03_025310_add_foreign_keys_to_product_variant_options_table.php +32 -0
- package/server/migrations/2023_05_03_025310_add_foreign_keys_to_product_variants_table.php +32 -0
- package/server/migrations/2023_05_03_025310_add_foreign_keys_to_products_table.php +44 -0
- package/server/migrations/2023_05_03_025310_add_foreign_keys_to_reviews_table.php +38 -0
- package/server/migrations/2023_05_03_025310_add_foreign_keys_to_store_hours_table.php +32 -0
- package/server/migrations/2023_05_03_025310_add_foreign_keys_to_store_locations_table.php +40 -0
- package/server/migrations/2023_05_03_025310_add_foreign_keys_to_stores_table.php +42 -0
- package/server/migrations/2023_05_03_025310_add_foreign_keys_to_votes_table.php +38 -0
- package/server/src/Auth/Schemas/Storefront.php +95 -0
- package/server/src/Console/Commands/NotifyStorefrontOrderNearby.php +86 -0
- package/server/src/Expansions/EntityExpansion.php +44 -0
- package/server/src/Http/Controllers/ActionController.php +119 -0
- package/server/src/Http/Controllers/AddonCategoryController.php +13 -0
- package/server/src/Http/Controllers/CustomerController.php +13 -0
- package/server/src/Http/Controllers/GatewayController.php +13 -0
- package/server/src/Http/Controllers/MetricsController.php +71 -0
- package/server/src/Http/Controllers/NetworkController.php +170 -0
- package/server/src/Http/Controllers/NotificationChannelController.php +13 -0
- package/server/src/Http/Controllers/OrderController.php +154 -0
- package/server/src/Http/Controllers/ProductAddonCategoryController.php +14 -0
- package/server/src/Http/Controllers/ProductAddonController.php +14 -0
- package/server/src/Http/Controllers/ProductController.php +123 -0
- package/server/src/Http/Controllers/ProductHourController.php +13 -0
- package/server/src/Http/Controllers/ProductVariantController.php +13 -0
- package/server/src/Http/Controllers/ProductVariantOptionController.php +13 -0
- package/server/src/Http/Controllers/ReviewController.php +13 -0
- package/server/src/Http/Controllers/StoreController.php +26 -0
- package/server/src/Http/Controllers/StoreHourController.php +13 -0
- package/server/src/Http/Controllers/StoreLocationController.php +13 -0
- package/server/src/Http/Controllers/StorefrontController.php +15 -0
- package/server/src/Http/Controllers/VoteController.php +13 -0
- package/server/src/Http/Controllers/v1/CartController.php +161 -0
- package/server/src/Http/Controllers/v1/CategoryController.php +138 -0
- package/server/src/Http/Controllers/v1/CheckoutController.php +957 -0
- package/server/src/Http/Controllers/v1/CustomerController.php +482 -0
- package/server/src/Http/Controllers/v1/GatewayControllerController.php +11 -0
- package/server/src/Http/Controllers/v1/NetworkController.php +281 -0
- package/server/src/Http/Controllers/v1/PaymentMethodController.php +11 -0
- package/server/src/Http/Controllers/v1/ProductController.php +94 -0
- package/server/src/Http/Controllers/v1/ReviewController.php +270 -0
- package/server/src/Http/Controllers/v1/ServiceQuoteController.php +402 -0
- package/server/src/Http/Controllers/v1/StoreController.php +176 -0
- package/server/src/Http/Filter/AddonCategoryFilter.php +19 -0
- package/server/src/Http/Filter/CustomerFilter.php +18 -0
- package/server/src/Http/Filter/GatewayFilter.php +13 -0
- package/server/src/Http/Filter/NetworkFilter.php +18 -0
- package/server/src/Http/Filter/NotificationChannelFilter.php +13 -0
- package/server/src/Http/Filter/OrderFilter.php +46 -0
- package/server/src/Http/Filter/ProductFilter.php +28 -0
- package/server/src/Http/Filter/StoreFilter.php +42 -0
- package/server/src/Http/Filter/StoreLocationFilter.php +23 -0
- package/server/src/Http/Middleware/SetStorefrontSession.php +130 -0
- package/server/src/Http/Requests/AddStoreToNetworkCategory.php +45 -0
- package/server/src/Http/Requests/CaptureOrderRequest.php +30 -0
- package/server/src/Http/Requests/CreateCustomerRequest.php +44 -0
- package/server/src/Http/Requests/CreateReviewRequest.php +34 -0
- package/server/src/Http/Requests/GetServiceQuoteFromCart.php +40 -0
- package/server/src/Http/Requests/InitializeCheckoutRequest.php +38 -0
- package/server/src/Http/Requests/NetworkActionRequest.php +43 -0
- package/server/src/Http/Requests/VerifyCreateCustomerRequest.php +31 -0
- package/server/src/Http/Resources/Cart.php +31 -0
- package/server/src/Http/Resources/Category.php +48 -0
- package/server/src/Http/Resources/Customer.php +36 -0
- package/server/src/Http/Resources/Gateway.php +32 -0
- package/server/src/Http/Resources/Media.php +29 -0
- package/server/src/Http/Resources/Network.php +48 -0
- package/server/src/Http/Resources/Product.php +209 -0
- package/server/src/Http/Resources/Review.php +45 -0
- package/server/src/Http/Resources/ReviewCustomer.php +60 -0
- package/server/src/Http/Resources/Store.php +76 -0
- package/server/src/Http/Resources/StoreHour.php +29 -0
- package/server/src/Http/Resources/StoreLocation.php +33 -0
- package/server/src/Imports/ProductsImport.php +20 -0
- package/server/src/Jobs/DownloadProductImageUrl.php +60 -0
- package/server/src/Listeners/HandleOrderCompleted.php +31 -0
- package/server/src/Listeners/HandleOrderDispatched.php +34 -0
- package/server/src/Listeners/HandleOrderDriverAssigned.php +37 -0
- package/server/src/Listeners/HandleOrderStarted.php +27 -0
- package/server/src/Mail/StorefrontNetworkInvite.php +48 -0
- package/server/src/Models/AddonCategory.php +30 -0
- package/server/src/Models/Cart.php +691 -0
- package/server/src/Models/Checkout.php +166 -0
- package/server/src/Models/Customer.php +88 -0
- package/server/src/Models/Gateway.php +165 -0
- package/server/src/Models/Network.php +300 -0
- package/server/src/Models/NetworkStore.php +86 -0
- package/server/src/Models/NotificationChannel.php +147 -0
- package/server/src/Models/PaymentMethod.php +99 -0
- package/server/src/Models/Product.php +315 -0
- package/server/src/Models/ProductAddon.php +128 -0
- package/server/src/Models/ProductAddonCategory.php +90 -0
- package/server/src/Models/ProductHour.php +59 -0
- package/server/src/Models/ProductStoreLocation.php +77 -0
- package/server/src/Models/ProductVariant.php +125 -0
- package/server/src/Models/ProductVariantOption.php +86 -0
- package/server/src/Models/Review.php +127 -0
- package/server/src/Models/Store.php +478 -0
- package/server/src/Models/StoreHour.php +59 -0
- package/server/src/Models/StoreLocation.php +126 -0
- package/server/src/Models/StorefrontModel.php +22 -0
- package/server/src/Models/Vote.php +84 -0
- package/server/src/Notifications/StorefrontOrderCanceled.php +196 -0
- package/server/src/Notifications/StorefrontOrderCompleted.php +201 -0
- package/server/src/Notifications/StorefrontOrderCreated.php +157 -0
- package/server/src/Notifications/StorefrontOrderDriverAssigned.php +200 -0
- package/server/src/Notifications/StorefrontOrderEnroute.php +199 -0
- package/server/src/Notifications/StorefrontOrderNearby.php +201 -0
- package/server/src/Notifications/StorefrontOrderPreparing.php +202 -0
- package/server/src/Notifications/StorefrontOrderReadyForPickup.php +202 -0
- package/server/src/Observers/NetworkObserver.php +40 -0
- package/server/src/Observers/ProductObserver.php +118 -0
- package/server/src/Providers/EventServiceProvider.php +23 -0
- package/server/src/Providers/StorefrontServiceProvider.php +103 -0
- package/server/src/Support/Metrics.php +193 -0
- package/server/src/Support/OrderConfig.php +13 -0
- package/server/src/Support/QPay.php +208 -0
- package/server/src/Support/Storefront.php +201 -0
- package/server/src/routes.php +180 -0
- package/server/tests/Feature.php +5 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<?php
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* -------------------------------------------
|
|
5
|
+
* Fleetbase Core API Configuration
|
|
6
|
+
* -------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
return [
|
|
9
|
+
'api' => [
|
|
10
|
+
'version' => '0.0.1',
|
|
11
|
+
'routing' => [
|
|
12
|
+
'prefix' => 'storefront',
|
|
13
|
+
'internal_prefix' => 'int'
|
|
14
|
+
],
|
|
15
|
+
],
|
|
16
|
+
'connection' => [
|
|
17
|
+
'db' => env('STOREFRONT_DB_CONNECTION', 'storefront')
|
|
18
|
+
]
|
|
19
|
+
];
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
<?php
|
|
2
|
+
|
|
3
|
+
return [
|
|
4
|
+
'username' => env('TWILIO_USERNAME'), // optional when using auth token
|
|
5
|
+
'password' => env('TWILIO_PASSWORD'), // optional when using auth token
|
|
6
|
+
'auth_token' => env('TWILIO_TOKEN'), // optional when using username and password
|
|
7
|
+
'account_sid' => env('TWILIO_SID'),
|
|
8
|
+
|
|
9
|
+
'from' => env('TWILIO_FROM'), // optional
|
|
10
|
+
'alphanumeric_sender' => env('TWILIO_ALPHA_SENDER'),
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* See https://www.twilio.com/docs/sms/services.
|
|
14
|
+
*/
|
|
15
|
+
'sms_service_sid' => env('TWILIO_SMS_SERVICE_SID'),
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Specify a number where all calls/messages should be routed. This can be used in development/staging environments
|
|
19
|
+
* for testing.
|
|
20
|
+
*/
|
|
21
|
+
'debug_to' => env('TWILIO_DEBUG_TO'),
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* If an exception is thrown with one of these error codes, it will be caught & suppressed.
|
|
25
|
+
* To replicate the 2.x behaviour, specify '*' in the array, which will cause all exceptions to be suppressed.
|
|
26
|
+
* Suppressed errors will not be logged or reported, but the `NotificationFailed` event will be emitted.
|
|
27
|
+
*
|
|
28
|
+
* @see https://www.twilio.com/docs/api/errors
|
|
29
|
+
*/
|
|
30
|
+
'ignored_error_codes' => [
|
|
31
|
+
21608, // The 'to' phone number provided is not yet verified for this account.
|
|
32
|
+
21211, // Invalid 'To' Phone Number
|
|
33
|
+
21614, // 'To' number is not a valid mobile number
|
|
34
|
+
21408, // Permission to send an SMS has not been enabled for the region indicated by the 'To' number
|
|
35
|
+
],
|
|
36
|
+
];
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
<?php
|
|
2
|
+
|
|
3
|
+
use Illuminate\Database\Migrations\Migration;
|
|
4
|
+
use Illuminate\Database\Schema\Blueprint;
|
|
5
|
+
use Illuminate\Support\Facades\Schema;
|
|
6
|
+
|
|
7
|
+
return new class extends Migration
|
|
8
|
+
{
|
|
9
|
+
/**
|
|
10
|
+
* Run the migrations.
|
|
11
|
+
*
|
|
12
|
+
* @return void
|
|
13
|
+
*/
|
|
14
|
+
public function up()
|
|
15
|
+
{
|
|
16
|
+
Schema::connection(config('storefront.connection.db'))->create('carts', function (Blueprint $table) {
|
|
17
|
+
$table->bigIncrements('id');
|
|
18
|
+
$table->char('uuid', 36)->nullable()->unique();
|
|
19
|
+
$table->string('public_id')->nullable()->index();
|
|
20
|
+
$table->char('company_uuid', 36)->nullable()->index('carts_company_uuid_foreign');
|
|
21
|
+
$table->char('user_uuid', 36)->nullable()->index('carts_user_uuid_foreign');
|
|
22
|
+
$table->char('checkout_uuid', 36)->nullable()->index('carts_checkout_uuid_foreign');
|
|
23
|
+
$table->string('customer_id')->nullable();
|
|
24
|
+
$table->string('unique_identifier')->nullable();
|
|
25
|
+
$table->string('currency')->nullable();
|
|
26
|
+
$table->string('discount_code')->nullable();
|
|
27
|
+
$table->json('items')->nullable();
|
|
28
|
+
$table->json('events')->nullable();
|
|
29
|
+
$table->dateTime('expires_at')->nullable()->index();
|
|
30
|
+
$table->softDeletes();
|
|
31
|
+
$table->timestamps();
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Reverse the migrations.
|
|
37
|
+
*
|
|
38
|
+
* @return void
|
|
39
|
+
*/
|
|
40
|
+
public function down()
|
|
41
|
+
{
|
|
42
|
+
Schema::connection(config('storefront.connection.db'))->dropIfExists('carts');
|
|
43
|
+
}
|
|
44
|
+
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
<?php
|
|
2
|
+
|
|
3
|
+
use Illuminate\Database\Migrations\Migration;
|
|
4
|
+
use Illuminate\Database\Schema\Blueprint;
|
|
5
|
+
use Illuminate\Support\Facades\Schema;
|
|
6
|
+
|
|
7
|
+
return new class extends Migration
|
|
8
|
+
{
|
|
9
|
+
/**
|
|
10
|
+
* Run the migrations.
|
|
11
|
+
*
|
|
12
|
+
* @return void
|
|
13
|
+
*/
|
|
14
|
+
public function up()
|
|
15
|
+
{
|
|
16
|
+
Schema::connection(config('storefront.connection.db'))->create('checkouts', function (Blueprint $table) {
|
|
17
|
+
$table->bigIncrements('id');
|
|
18
|
+
$table->char('uuid', 36)->nullable()->unique();
|
|
19
|
+
$table->string('public_id', 191)->nullable()->index();
|
|
20
|
+
$table->char('company_uuid', 36)->nullable()->index('checkouts_company_uuid_foreign');
|
|
21
|
+
$table->char('order_uuid', 36)->nullable()->index('checkouts_order_uuid_foreign');
|
|
22
|
+
$table->char('cart_uuid', 36)->nullable()->index('checkouts_cart_uuid_foreign');
|
|
23
|
+
$table->char('store_uuid', 36)->nullable()->index('checkouts_store_uuid_foreign');
|
|
24
|
+
$table->char('network_uuid', 36)->nullable()->index('checkouts_network_uuid_foreign');
|
|
25
|
+
$table->char('gateway_uuid', 36)->nullable()->index('checkouts_gateway_uuid_foreign');
|
|
26
|
+
$table->char('service_quote_uuid', 36)->nullable()->index('checkouts_service_quote_uuid_foreign');
|
|
27
|
+
$table->char('owner_uuid', 36)->nullable();
|
|
28
|
+
$table->string('owner_type')->nullable();
|
|
29
|
+
$table->string('token')->nullable();
|
|
30
|
+
$table->integer('amount')->nullable();
|
|
31
|
+
$table->string('currency')->nullable();
|
|
32
|
+
$table->boolean('is_cod')->default(false);
|
|
33
|
+
$table->boolean('is_pickup')->default(false);
|
|
34
|
+
$table->json('options')->nullable();
|
|
35
|
+
$table->json('cart_state')->nullable();
|
|
36
|
+
$table->boolean('captured')->default(false);
|
|
37
|
+
$table->softDeletes();
|
|
38
|
+
$table->timestamps();
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Reverse the migrations.
|
|
44
|
+
*
|
|
45
|
+
* @return void
|
|
46
|
+
*/
|
|
47
|
+
public function down()
|
|
48
|
+
{
|
|
49
|
+
Schema::connection(config('storefront.connection.db'))->dropIfExists('checkouts');
|
|
50
|
+
}
|
|
51
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
<?php
|
|
2
|
+
|
|
3
|
+
use Illuminate\Database\Migrations\Migration;
|
|
4
|
+
use Illuminate\Database\Schema\Blueprint;
|
|
5
|
+
use Illuminate\Support\Facades\Schema;
|
|
6
|
+
|
|
7
|
+
return new class extends Migration
|
|
8
|
+
{
|
|
9
|
+
/**
|
|
10
|
+
* Run the migrations.
|
|
11
|
+
*
|
|
12
|
+
* @return void
|
|
13
|
+
*/
|
|
14
|
+
public function up()
|
|
15
|
+
{
|
|
16
|
+
Schema::connection(config('storefront.connection.db'))->create('gateways', function (Blueprint $table) {
|
|
17
|
+
$table->bigIncrements('id');
|
|
18
|
+
$table->char('uuid', 36)->nullable()->unique();
|
|
19
|
+
$table->string('public_id', 191)->nullable()->index();
|
|
20
|
+
$table->char('company_uuid', 36)->nullable()->index('gateways_company_uuid_foreign');
|
|
21
|
+
$table->char('created_by_uuid', 36)->nullable()->index('gateways_created_by_uuid_foreign');
|
|
22
|
+
$table->char('logo_file_uuid', 36)->nullable()->index('gateways_logo_file_uuid_foreign');
|
|
23
|
+
$table->char('owner_uuid', 36)->nullable();
|
|
24
|
+
$table->string('owner_type')->nullable();
|
|
25
|
+
$table->string('name')->nullable();
|
|
26
|
+
$table->string('description')->nullable();
|
|
27
|
+
$table->string('code')->nullable();
|
|
28
|
+
$table->string('type')->nullable();
|
|
29
|
+
$table->boolean('sandbox')->default(false)->index();
|
|
30
|
+
$table->json('meta')->nullable();
|
|
31
|
+
$table->json('config')->nullable();
|
|
32
|
+
$table->string('return_url')->nullable();
|
|
33
|
+
$table->string('callback_url')->nullable();
|
|
34
|
+
$table->softDeletes();
|
|
35
|
+
$table->timestamps();
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Reverse the migrations.
|
|
41
|
+
*
|
|
42
|
+
* @return void
|
|
43
|
+
*/
|
|
44
|
+
public function down()
|
|
45
|
+
{
|
|
46
|
+
Schema::connection(config('storefront.connection.db'))->dropIfExists('gateways');
|
|
47
|
+
}
|
|
48
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
<?php
|
|
2
|
+
|
|
3
|
+
use Illuminate\Database\Migrations\Migration;
|
|
4
|
+
use Illuminate\Database\Schema\Blueprint;
|
|
5
|
+
use Illuminate\Support\Facades\Schema;
|
|
6
|
+
|
|
7
|
+
return new class extends Migration
|
|
8
|
+
{
|
|
9
|
+
/**
|
|
10
|
+
* Run the migrations.
|
|
11
|
+
*
|
|
12
|
+
* @return void
|
|
13
|
+
*/
|
|
14
|
+
public function up()
|
|
15
|
+
{
|
|
16
|
+
Schema::connection(config('storefront.connection.db'))->create('network_stores', function (Blueprint $table) {
|
|
17
|
+
$table->bigIncrements('id');
|
|
18
|
+
$table->char('uuid', 36)->nullable()->unique();
|
|
19
|
+
$table->string('network_uuid', 191)->nullable()->index('network_stores_network_uuid_foreign');
|
|
20
|
+
$table->string('store_uuid', 191)->nullable()->index('network_stores_store_uuid_foreign');
|
|
21
|
+
$table->char('category_uuid', 36)->nullable()->index('network_stores_category_uuid_foreign');
|
|
22
|
+
$table->softDeletes();
|
|
23
|
+
$table->timestamps();
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Reverse the migrations.
|
|
29
|
+
*
|
|
30
|
+
* @return void
|
|
31
|
+
*/
|
|
32
|
+
public function down()
|
|
33
|
+
{
|
|
34
|
+
Schema::connection(config('storefront.connection.db'))->dropIfExists('network_stores');
|
|
35
|
+
}
|
|
36
|
+
};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
<?php
|
|
2
|
+
|
|
3
|
+
use Illuminate\Database\Migrations\Migration;
|
|
4
|
+
use Illuminate\Database\Schema\Blueprint;
|
|
5
|
+
use Illuminate\Support\Facades\Schema;
|
|
6
|
+
|
|
7
|
+
return new class extends Migration
|
|
8
|
+
{
|
|
9
|
+
/**
|
|
10
|
+
* Run the migrations.
|
|
11
|
+
*
|
|
12
|
+
* @return void
|
|
13
|
+
*/
|
|
14
|
+
public function up()
|
|
15
|
+
{
|
|
16
|
+
Schema::connection(config('storefront.connection.db'))->create('networks', function (Blueprint $table) {
|
|
17
|
+
$table->bigIncrements('id');
|
|
18
|
+
$table->string('public_id', 191)->nullable()->index();
|
|
19
|
+
$table->char('uuid', 36)->nullable()->unique();
|
|
20
|
+
$table->string('created_by_uuid', 191)->nullable()->index('networks_created_by_uuid_foreign');
|
|
21
|
+
$table->string('company_uuid', 191)->nullable()->index('networks_company_uuid_foreign');
|
|
22
|
+
$table->char('logo_uuid', 36)->nullable()->index('networks_logo_uuid_foreign');
|
|
23
|
+
$table->char('backdrop_uuid', 36)->nullable()->index('networks_backdrop_uuid_foreign');
|
|
24
|
+
$table->string('name')->nullable();
|
|
25
|
+
$table->longText('key')->nullable();
|
|
26
|
+
$table->boolean('online')->default(true)->index();
|
|
27
|
+
$table->string('currency')->nullable();
|
|
28
|
+
$table->string('timezone')->nullable();
|
|
29
|
+
$table->string('pod_method')->nullable();
|
|
30
|
+
$table->json('options')->nullable();
|
|
31
|
+
$table->json('alertable')->nullable();
|
|
32
|
+
$table->string('description')->nullable();
|
|
33
|
+
$table->string('phone')->nullable();
|
|
34
|
+
$table->string('email')->nullable();
|
|
35
|
+
$table->string('website')->nullable();
|
|
36
|
+
$table->string('facebook')->nullable();
|
|
37
|
+
$table->string('instagram')->nullable();
|
|
38
|
+
$table->string('twitter')->nullable();
|
|
39
|
+
$table->json('tags')->nullable();
|
|
40
|
+
$table->json('translations')->nullable();
|
|
41
|
+
$table->string('slug', 191)->nullable()->index();
|
|
42
|
+
$table->softDeletes();
|
|
43
|
+
$table->timestamps();
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Reverse the migrations.
|
|
49
|
+
*
|
|
50
|
+
* @return void
|
|
51
|
+
*/
|
|
52
|
+
public function down()
|
|
53
|
+
{
|
|
54
|
+
Schema::connection(config('storefront.connection.db'))->dropIfExists('networks');
|
|
55
|
+
}
|
|
56
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
<?php
|
|
2
|
+
|
|
3
|
+
use Illuminate\Database\Migrations\Migration;
|
|
4
|
+
use Illuminate\Database\Schema\Blueprint;
|
|
5
|
+
use Illuminate\Support\Facades\Schema;
|
|
6
|
+
|
|
7
|
+
return new class extends Migration
|
|
8
|
+
{
|
|
9
|
+
/**
|
|
10
|
+
* Run the migrations.
|
|
11
|
+
*
|
|
12
|
+
* @return void
|
|
13
|
+
*/
|
|
14
|
+
public function up()
|
|
15
|
+
{
|
|
16
|
+
Schema::connection(config('storefront.connection.db'))->create('notification_channels', function (Blueprint $table) {
|
|
17
|
+
$table->bigIncrements('id');
|
|
18
|
+
$table->char('uuid', 36)->nullable()->index();
|
|
19
|
+
$table->char('company_uuid', 36)->nullable()->index('notification_channels_company_uuid_foreign');
|
|
20
|
+
$table->char('created_by_uuid', 36)->nullable()->index('notification_channels_created_by_uuid_foreign');
|
|
21
|
+
$table->string('owner_uuid')->nullable();
|
|
22
|
+
$table->string('owner_type')->nullable();
|
|
23
|
+
$table->char('certificate_uuid', 36)->nullable()->index('notification_channels_certificate_uuid_foreign');
|
|
24
|
+
$table->json('config')->nullable();
|
|
25
|
+
$table->json('options')->nullable();
|
|
26
|
+
$table->string('name')->nullable();
|
|
27
|
+
$table->string('scheme')->nullable();
|
|
28
|
+
$table->string('app_key')->nullable();
|
|
29
|
+
$table->softDeletes();
|
|
30
|
+
$table->timestamps();
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Reverse the migrations.
|
|
36
|
+
*
|
|
37
|
+
* @return void
|
|
38
|
+
*/
|
|
39
|
+
public function down()
|
|
40
|
+
{
|
|
41
|
+
Schema::connection(config('storefront.connection.db'))->dropIfExists('notification_channels');
|
|
42
|
+
}
|
|
43
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
<?php
|
|
2
|
+
|
|
3
|
+
use Illuminate\Database\Migrations\Migration;
|
|
4
|
+
use Illuminate\Database\Schema\Blueprint;
|
|
5
|
+
use Illuminate\Support\Facades\Schema;
|
|
6
|
+
|
|
7
|
+
return new class extends Migration
|
|
8
|
+
{
|
|
9
|
+
/**
|
|
10
|
+
* Run the migrations.
|
|
11
|
+
*
|
|
12
|
+
* @return void
|
|
13
|
+
*/
|
|
14
|
+
public function up()
|
|
15
|
+
{
|
|
16
|
+
Schema::connection(config('storefront.connection.db'))->create('payment_methods', function (Blueprint $table) {
|
|
17
|
+
$table->bigIncrements('id');
|
|
18
|
+
$table->char('uuid', 36)->nullable()->unique();
|
|
19
|
+
$table->string('public_id', 191)->nullable()->index();
|
|
20
|
+
$table->char('company_uuid', 36)->nullable()->index('payment_methods_company_uuid_foreign');
|
|
21
|
+
$table->char('store_uuid', 36)->nullable()->index('payment_methods_store_uuid_foreign');
|
|
22
|
+
$table->char('gateway_uuid', 36)->nullable()->index('payment_methods_gateway_uuid_foreign');
|
|
23
|
+
$table->char('owner_uuid', 36)->nullable();
|
|
24
|
+
$table->string('owner_type')->nullable();
|
|
25
|
+
$table->string('gateway_id')->nullable();
|
|
26
|
+
$table->string('type')->nullable();
|
|
27
|
+
$table->string('brand')->nullable();
|
|
28
|
+
$table->string('last4')->nullable();
|
|
29
|
+
$table->json('meta')->nullable();
|
|
30
|
+
$table->softDeletes();
|
|
31
|
+
$table->timestamps();
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Reverse the migrations.
|
|
37
|
+
*
|
|
38
|
+
* @return void
|
|
39
|
+
*/
|
|
40
|
+
public function down()
|
|
41
|
+
{
|
|
42
|
+
Schema::connection(config('storefront.connection.db'))->dropIfExists('payment_methods');
|
|
43
|
+
}
|
|
44
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
<?php
|
|
2
|
+
|
|
3
|
+
use Illuminate\Database\Migrations\Migration;
|
|
4
|
+
use Illuminate\Database\Schema\Blueprint;
|
|
5
|
+
use Illuminate\Support\Facades\Schema;
|
|
6
|
+
|
|
7
|
+
return new class extends Migration
|
|
8
|
+
{
|
|
9
|
+
/**
|
|
10
|
+
* Run the migrations.
|
|
11
|
+
*
|
|
12
|
+
* @return void
|
|
13
|
+
*/
|
|
14
|
+
public function up()
|
|
15
|
+
{
|
|
16
|
+
Schema::connection(config('storefront.connection.db'))->create('product_addon_categories', function (Blueprint $table) {
|
|
17
|
+
$table->bigIncrements('id');
|
|
18
|
+
$table->char('uuid', 36)->nullable()->unique();
|
|
19
|
+
$table->string('product_uuid', 191)->nullable()->index('product_addon_categories_product_uuid_foreign');
|
|
20
|
+
$table->string('category_uuid', 191)->nullable()->index('product_addon_categories_category_uuid_foreign');
|
|
21
|
+
$table->json('excluded_addons')->nullable();
|
|
22
|
+
$table->mediumInteger('max_selectable')->nullable();
|
|
23
|
+
$table->boolean('is_required')->nullable();
|
|
24
|
+
$table->softDeletes();
|
|
25
|
+
$table->timestamps();
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Reverse the migrations.
|
|
31
|
+
*
|
|
32
|
+
* @return void
|
|
33
|
+
*/
|
|
34
|
+
public function down()
|
|
35
|
+
{
|
|
36
|
+
Schema::connection(config('storefront.connection.db'))->dropIfExists('product_addon_categories');
|
|
37
|
+
}
|
|
38
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
<?php
|
|
2
|
+
|
|
3
|
+
use Illuminate\Database\Migrations\Migration;
|
|
4
|
+
use Illuminate\Database\Schema\Blueprint;
|
|
5
|
+
use Illuminate\Support\Facades\Schema;
|
|
6
|
+
|
|
7
|
+
return new class extends Migration
|
|
8
|
+
{
|
|
9
|
+
/**
|
|
10
|
+
* Run the migrations.
|
|
11
|
+
*
|
|
12
|
+
* @return void
|
|
13
|
+
*/
|
|
14
|
+
public function up()
|
|
15
|
+
{
|
|
16
|
+
Schema::connection(config('storefront.connection.db'))->create('product_addons', function (Blueprint $table) {
|
|
17
|
+
$table->bigIncrements('id');
|
|
18
|
+
$table->string('public_id', 191)->nullable()->index();
|
|
19
|
+
$table->char('uuid', 36)->nullable()->unique();
|
|
20
|
+
$table->string('created_by_uuid', 191)->nullable()->index('product_addons_created_by_uuid_foreign');
|
|
21
|
+
$table->string('category_uuid', 191)->nullable()->index('product_addons_category_uuid_foreign');
|
|
22
|
+
$table->string('name')->nullable();
|
|
23
|
+
$table->string('description')->nullable();
|
|
24
|
+
$table->json('translations')->nullable();
|
|
25
|
+
$table->integer('price')->default(0);
|
|
26
|
+
$table->integer('sale_price')->default(0);
|
|
27
|
+
$table->boolean('is_on_sale')->nullable();
|
|
28
|
+
$table->string('slug', 191)->nullable()->index();
|
|
29
|
+
$table->softDeletes();
|
|
30
|
+
$table->timestamps();
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Reverse the migrations.
|
|
36
|
+
*
|
|
37
|
+
* @return void
|
|
38
|
+
*/
|
|
39
|
+
public function down()
|
|
40
|
+
{
|
|
41
|
+
Schema::connection(config('storefront.connection.db'))->dropIfExists('product_addons');
|
|
42
|
+
}
|
|
43
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
<?php
|
|
2
|
+
|
|
3
|
+
use Illuminate\Database\Migrations\Migration;
|
|
4
|
+
use Illuminate\Database\Schema\Blueprint;
|
|
5
|
+
use Illuminate\Support\Facades\Schema;
|
|
6
|
+
|
|
7
|
+
return new class extends Migration
|
|
8
|
+
{
|
|
9
|
+
/**
|
|
10
|
+
* Run the migrations.
|
|
11
|
+
*
|
|
12
|
+
* @return void
|
|
13
|
+
*/
|
|
14
|
+
public function up()
|
|
15
|
+
{
|
|
16
|
+
Schema::connection(config('storefront.connection.db'))->create('product_hours', function (Blueprint $table) {
|
|
17
|
+
$table->bigIncrements('id');
|
|
18
|
+
$table->char('uuid', 36)->nullable()->unique();
|
|
19
|
+
$table->string('product_uuid')->nullable()->index('product_hours_product_uuid_foreign');
|
|
20
|
+
$table->string('day_of_week')->nullable();
|
|
21
|
+
$table->time('start');
|
|
22
|
+
$table->time('end');
|
|
23
|
+
$table->softDeletes();
|
|
24
|
+
$table->timestamps();
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Reverse the migrations.
|
|
30
|
+
*
|
|
31
|
+
* @return void
|
|
32
|
+
*/
|
|
33
|
+
public function down()
|
|
34
|
+
{
|
|
35
|
+
Schema::connection(config('storefront.connection.db'))->dropIfExists('product_hours');
|
|
36
|
+
}
|
|
37
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
<?php
|
|
2
|
+
|
|
3
|
+
use Illuminate\Database\Migrations\Migration;
|
|
4
|
+
use Illuminate\Database\Schema\Blueprint;
|
|
5
|
+
use Illuminate\Support\Facades\Schema;
|
|
6
|
+
|
|
7
|
+
return new class extends Migration
|
|
8
|
+
{
|
|
9
|
+
/**
|
|
10
|
+
* Run the migrations.
|
|
11
|
+
*
|
|
12
|
+
* @return void
|
|
13
|
+
*/
|
|
14
|
+
public function up()
|
|
15
|
+
{
|
|
16
|
+
Schema::connection(config('storefront.connection.db'))->create('product_store_locations', function (Blueprint $table) {
|
|
17
|
+
$table->bigIncrements('id');
|
|
18
|
+
$table->string('product_uuid', 191)->nullable()->index('product_store_locations_product_uuid_foreign');
|
|
19
|
+
$table->string('store_location_uuid', 191)->nullable()->index('product_store_locations_store_location_uuid_foreign');
|
|
20
|
+
$table->softDeletes();
|
|
21
|
+
$table->timestamps();
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Reverse the migrations.
|
|
27
|
+
*
|
|
28
|
+
* @return void
|
|
29
|
+
*/
|
|
30
|
+
public function down()
|
|
31
|
+
{
|
|
32
|
+
Schema::connection(config('storefront.connection.db'))->dropIfExists('product_store_locations');
|
|
33
|
+
}
|
|
34
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
<?php
|
|
2
|
+
|
|
3
|
+
use Illuminate\Database\Migrations\Migration;
|
|
4
|
+
use Illuminate\Database\Schema\Blueprint;
|
|
5
|
+
use Illuminate\Support\Facades\Schema;
|
|
6
|
+
|
|
7
|
+
return new class extends Migration
|
|
8
|
+
{
|
|
9
|
+
/**
|
|
10
|
+
* Run the migrations.
|
|
11
|
+
*
|
|
12
|
+
* @return void
|
|
13
|
+
*/
|
|
14
|
+
public function up()
|
|
15
|
+
{
|
|
16
|
+
Schema::connection(config('storefront.connection.db'))->create('product_variant_options', function (Blueprint $table) {
|
|
17
|
+
$table->bigIncrements('id');
|
|
18
|
+
$table->string('public_id', 191)->nullable()->index();
|
|
19
|
+
$table->char('uuid', 36)->nullable()->unique();
|
|
20
|
+
$table->string('product_variant_uuid', 191)->nullable()->index('product_variant_options_product_variant_uuid_foreign');
|
|
21
|
+
$table->string('name')->nullable();
|
|
22
|
+
$table->string('description')->nullable();
|
|
23
|
+
$table->json('translations')->nullable();
|
|
24
|
+
$table->json('meta')->nullable();
|
|
25
|
+
$table->integer('additional_cost')->default(0);
|
|
26
|
+
$table->softDeletes();
|
|
27
|
+
$table->timestamps();
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Reverse the migrations.
|
|
33
|
+
*
|
|
34
|
+
* @return void
|
|
35
|
+
*/
|
|
36
|
+
public function down()
|
|
37
|
+
{
|
|
38
|
+
Schema::connection(config('storefront.connection.db'))->dropIfExists('product_variant_options');
|
|
39
|
+
}
|
|
40
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
<?php
|
|
2
|
+
|
|
3
|
+
use Illuminate\Database\Migrations\Migration;
|
|
4
|
+
use Illuminate\Database\Schema\Blueprint;
|
|
5
|
+
use Illuminate\Support\Facades\Schema;
|
|
6
|
+
|
|
7
|
+
return new class extends Migration
|
|
8
|
+
{
|
|
9
|
+
/**
|
|
10
|
+
* Run the migrations.
|
|
11
|
+
*
|
|
12
|
+
* @return void
|
|
13
|
+
*/
|
|
14
|
+
public function up()
|
|
15
|
+
{
|
|
16
|
+
Schema::connection(config('storefront.connection.db'))->create('product_variants', function (Blueprint $table) {
|
|
17
|
+
$table->bigIncrements('id');
|
|
18
|
+
$table->string('public_id', 191)->nullable()->index();
|
|
19
|
+
$table->char('uuid', 36)->nullable()->unique();
|
|
20
|
+
$table->string('product_uuid', 191)->nullable()->index('product_variants_product_uuid_foreign');
|
|
21
|
+
$table->string('name')->nullable();
|
|
22
|
+
$table->string('description')->nullable();
|
|
23
|
+
$table->json('translations')->nullable();
|
|
24
|
+
$table->json('meta')->nullable();
|
|
25
|
+
$table->boolean('is_multiselect')->default(false);
|
|
26
|
+
$table->boolean('is_required')->default(false);
|
|
27
|
+
$table->mediumInteger('min')->default(0);
|
|
28
|
+
$table->mediumInteger('max')->default(1);
|
|
29
|
+
$table->string('slug', 191)->nullable()->index();
|
|
30
|
+
$table->softDeletes();
|
|
31
|
+
$table->timestamps();
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Reverse the migrations.
|
|
37
|
+
*
|
|
38
|
+
* @return void
|
|
39
|
+
*/
|
|
40
|
+
public function down()
|
|
41
|
+
{
|
|
42
|
+
Schema::connection(config('storefront.connection.db'))->dropIfExists('product_variants');
|
|
43
|
+
}
|
|
44
|
+
};
|