diff --git a/app/Http/Requests/Admin/System/Setting/MarketplaceRequest.php b/app/Http/Requests/Admin/System/Setting/MarketplaceRequest.php index 28381a0..0e11c40 100644 --- a/app/Http/Requests/Admin/System/Setting/MarketplaceRequest.php +++ b/app/Http/Requests/Admin/System/Setting/MarketplaceRequest.php @@ -22,8 +22,6 @@ public function rules(): array 'tiktok_shop_affiliate_commission' => ['required', 'numeric', 'min:0', 'max:100'], 'tiktok_shop_shipping_subsidy' => ['required', 'numeric', 'min:0', 'max:100'], 'tiktok_shop_vat_rate' => ['required', 'numeric', 'min:0', 'max:100'], - 'tiktok_shop_url' => ['nullable', 'url', 'max:500'], - 'tiktok_shop_id' => ['nullable', 'string', 'max:100'], 'shopee_enabled' => ['required', 'boolean'], 'shopee_commission_fee' => ['required', 'numeric', 'min:0', 'max:100'], @@ -33,8 +31,6 @@ public function rules(): array 'shopee_affiliate_commission' => ['required', 'numeric', 'min:0', 'max:100'], 'shopee_shipping_subsidy' => ['required', 'numeric', 'min:0', 'max:100'], 'shopee_voucher_fee' => ['required', 'numeric', 'min:0', 'max:100'], - 'shopee_shop_url' => ['nullable', 'url', 'max:500'], - 'shopee_shop_id' => ['nullable', 'string', 'max:100'], ]; } } diff --git a/app/Services/System/Setting/MarketplaceService.php b/app/Services/System/Setting/MarketplaceService.php index 8ac80f0..504942e 100644 --- a/app/Services/System/Setting/MarketplaceService.php +++ b/app/Services/System/Setting/MarketplaceService.php @@ -18,8 +18,6 @@ public function marketplaceData(): array 'tiktok_shop_affiliate_commission' => $settings->tiktok_shop_affiliate_commission, 'tiktok_shop_shipping_subsidy' => $settings->tiktok_shop_shipping_subsidy, 'tiktok_shop_vat_rate' => $settings->tiktok_shop_vat_rate, - 'tiktok_shop_url' => $settings->tiktok_shop_url, - 'tiktok_shop_id' => $settings->tiktok_shop_id, 'shopee_enabled' => $settings->shopee_enabled, 'shopee_commission_fee' => $settings->shopee_commission_fee, 'shopee_transaction_fee' => $settings->shopee_transaction_fee, @@ -28,8 +26,6 @@ public function marketplaceData(): array 'shopee_affiliate_commission' => $settings->shopee_affiliate_commission, 'shopee_shipping_subsidy' => $settings->shopee_shipping_subsidy, 'shopee_voucher_fee' => $settings->shopee_voucher_fee, - 'shopee_shop_url' => $settings->shopee_shop_url, - 'shopee_shop_id' => $settings->shopee_shop_id, ]; } @@ -44,8 +40,6 @@ public function updateMarketplace(array $validated): void $settings->tiktok_shop_affiliate_commission = $validated['tiktok_shop_affiliate_commission']; $settings->tiktok_shop_shipping_subsidy = $validated['tiktok_shop_shipping_subsidy']; $settings->tiktok_shop_vat_rate = $validated['tiktok_shop_vat_rate']; - $settings->tiktok_shop_url = $validated['tiktok_shop_url'] ?? null; - $settings->tiktok_shop_id = $validated['tiktok_shop_id'] ?? null; $settings->shopee_enabled = $validated['shopee_enabled']; $settings->shopee_commission_fee = $validated['shopee_commission_fee']; @@ -55,8 +49,6 @@ public function updateMarketplace(array $validated): void $settings->shopee_affiliate_commission = $validated['shopee_affiliate_commission']; $settings->shopee_shipping_subsidy = $validated['shopee_shipping_subsidy']; $settings->shopee_voucher_fee = $validated['shopee_voucher_fee']; - $settings->shopee_shop_url = $validated['shopee_shop_url'] ?? null; - $settings->shopee_shop_id = $validated['shopee_shop_id'] ?? null; $settings->save(); } diff --git a/app/Settings/MarketplaceSettings.php b/app/Settings/MarketplaceSettings.php index 0157cc0..9251b66 100644 --- a/app/Settings/MarketplaceSettings.php +++ b/app/Settings/MarketplaceSettings.php @@ -20,10 +20,6 @@ class MarketplaceSettings extends Settings public float $tiktok_shop_vat_rate; - public ?string $tiktok_shop_url; - - public ?string $tiktok_shop_id; - public bool $shopee_enabled; public float $shopee_commission_fee; @@ -40,10 +36,6 @@ class MarketplaceSettings extends Settings public float $shopee_voucher_fee; - public ?string $shopee_shop_url; - - public ?string $shopee_shop_id; - public static function group(): string { return 'marketplace'; diff --git a/database/settings/2026_06_11_085959_create_app_settings.php b/database/settings/2026_06_11_085959_create_app_settings.php index 4f18177..0880f67 100644 --- a/database/settings/2026_06_11_085959_create_app_settings.php +++ b/database/settings/2026_06_11_085959_create_app_settings.php @@ -31,8 +31,6 @@ public function up(): void $blueprint->add('tiktok_shop_affiliate_commission', 0.0); $blueprint->add('tiktok_shop_shipping_subsidy', 0.0); $blueprint->add('tiktok_shop_vat_rate', 11.0); - $blueprint->add('tiktok_shop_url', null); - $blueprint->add('tiktok_shop_id', null); $blueprint->add('shopee_enabled', true); $blueprint->add('shopee_commission_fee', 6.0); @@ -42,8 +40,6 @@ public function up(): void $blueprint->add('shopee_affiliate_commission', 0.0); $blueprint->add('shopee_shipping_subsidy', 0.0); $blueprint->add('shopee_voucher_fee', 0.0); - $blueprint->add('shopee_shop_url', null); - $blueprint->add('shopee_shop_id', null); }); } }; diff --git a/resources/js/components/admin/setting/MarketplaceSection.vue b/resources/js/components/admin/setting/MarketplaceSection.vue index 87d2a88..df27520 100644 --- a/resources/js/components/admin/setting/MarketplaceSection.vue +++ b/resources/js/components/admin/setting/MarketplaceSection.vue @@ -4,12 +4,24 @@ import { Save, ShoppingBag, Store } from '@lucide/vue'; import { ref } from 'vue'; import { toast } from 'vue-sonner'; import { Button } from '@/components/ui/button'; -import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card'; -import { Field, FieldDescription, FieldError, FieldGroup, FieldLabel, FieldSet } from '@/components/ui/field'; +import { + Card, + CardContent +} from '@/components/ui/card'; +import { + Field, FieldError, + FieldGroup, + FieldLabel, + FieldSet +} from '@/components/ui/field'; import { Input } from '@/components/ui/input'; import { Switch } from '@/components/ui/switch'; +import { formErrors } from '@/lib/form'; import { cn } from '@/lib/utils'; -import type { MarketplacePlatform, MarketplaceSettingsData } from '@/types/setting'; +import type { + MarketplacePlatform, + MarketplaceSettingsData, +} from '@/types/setting'; const props = defineProps<{ data: MarketplaceSettingsData; @@ -34,8 +46,6 @@ const form = useForm({ tiktok_shop_affiliate_commission: props.data.tiktok_shop_affiliate_commission, tiktok_shop_shipping_subsidy: props.data.tiktok_shop_shipping_subsidy, tiktok_shop_vat_rate: props.data.tiktok_shop_vat_rate, - tiktok_shop_url: props.data.tiktok_shop_url ?? '', - tiktok_shop_id: props.data.tiktok_shop_id ?? '', shopee_enabled: props.data.shopee_enabled, shopee_commission_fee: props.data.shopee_commission_fee, @@ -45,8 +55,6 @@ const form = useForm({ shopee_affiliate_commission: props.data.shopee_affiliate_commission, shopee_shipping_subsidy: props.data.shopee_shipping_subsidy, shopee_voucher_fee: props.data.shopee_voucher_fee, - shopee_shop_url: props.data.shopee_shop_url ?? '', - shopee_shop_id: props.data.shopee_shop_id ?? '', }); function submit() { @@ -76,22 +84,6 @@ function submit() {