@php $currencies = ['BDT', 'USD', 'EUR', 'GBP']; // [field, label, type, select options] $sections = [ 'company' => ['Company Details', 'bi-building', [ ['company_name', 'Company name'], ['tagline', 'Tagline'], ['address', 'Address', 'textarea'], ['phone', 'Phone'], ['support_hours', 'Support hours'], ['email', 'Email', 'email'], ['currency', 'Currency', 'select', $currencies], ['timezone', 'Timezone'], ]], 'payments' => ['Payment Setup', 'bi-credit-card', []], 'email' => ['Email Setup', 'bi-envelope', [ ['mailer', 'Mailer', 'select', ['log', 'smtp']], ['host', 'Host'], ['port', 'Port', 'number'], ['username', 'Username'], ['password', 'Password', 'secret'], ['encryption', 'Encryption', 'select', ['tls', 'ssl']], ['from_name', 'From name'], ['from_address', 'From address', 'email'], ]], 'chat' => ['Chat', 'bi-chat-dots', [ ['enabled', 'Enable chat', 'checkbox'], ['provider', 'Provider', 'select', ['internal', 'whatsapp', 'messenger']], ['support_handle', 'Support handle'], ['welcome_message', 'Welcome message', 'textarea'], ['offline_message', 'Offline message', 'textarea'], ]], 'gtm' => ['GTM', 'bi-tags', [ ['enabled', 'Enable Google Tag Manager', 'checkbox'], ['container_id', 'Container ID'], ['environment_auth', 'Environment auth'], ]], 'pixel' => ['Facebook Pixel', 'bi-facebook', [ ['enabled', 'Enable Pixel', 'checkbox'], ['pixel_id', 'Pixel ID'], ['conversions_api_enabled', 'Enable Conversions API', 'checkbox'], ['access_token', 'Access token', 'secret'], ]], 'seo' => ['SEO', 'bi-search', [ ['meta_title', 'Meta title'], ['meta_description', 'Meta description', 'textarea'], ['canonical_url', 'Canonical URL', 'url'], ['og_title', 'OpenGraph title'], ['og_description', 'OpenGraph description', 'textarea'], ['og_type', 'OpenGraph type'], ['robots_index', 'Allow search engines to index the site', 'checkbox'], ]], 'geo' => ['GEO', 'bi-globe2', [ ['default_country', 'Default country'], ['allowed_countries', 'Allowed countries (comma-separated)', 'list'], ['default_currency', 'Default currency', 'select', $currencies], ['supported_currencies', 'Supported currencies (comma-separated)', 'list'], ['default_timezone', 'Default timezone'], ]], 'aeo' => ['AEO', 'bi-stars', [ ['enabled', 'Enable AEO', 'checkbox'], ['brand_summary', 'Brand summary', 'textarea'], ['structured_schema_enabled', 'Publish structured data', 'checkbox'], ['ai_category_discovery_enabled', 'Enable AI category discovery', 'checkbox'], ['llms_txt_directives', 'llms.txt directives', 'textarea'], ]], 'storefront' => ['Storefront', 'bi-shop', [ ['product_slider_seconds', 'Recommended products slide every (seconds)', 'number', ['min' => 1, 'max' => \App\Services\SettingsService::PRODUCT_SLIDER_MAX_SECONDS, 'step' => 1, 'required' => 'required']], ['category_slider_value', 'Recommended categories slide every (1-60)', 'number', ['min' => 1, 'max' => \App\Services\SettingsService::CATEGORY_SLIDER_MAX, 'step' => 1, 'required' => 'required']], ['category_slider_unit', 'Unit for the categories slider', 'select', \App\Services\SettingsService::CATEGORY_SLIDER_UNITS], ['delivery_charge_inside_dhaka', 'Delivery charge inside Dhaka district (৳)', 'number', ['min' => 0, 'max' => \App\Services\SettingsService::DELIVERY_CHARGE_MAX, 'step' => '0.01', 'required' => 'required']], ['delivery_charge_sub_dhaka', 'Delivery charge Sub-Dhaka (৳)', 'number', ['min' => 0, 'max' => \App\Services\SettingsService::DELIVERY_CHARGE_MAX, 'step' => '0.01', 'required' => 'required']], ['delivery_charge_outside_dhaka', 'Delivery charge outside Dhaka district (৳)', 'number', ['min' => 0, 'max' => \App\Services\SettingsService::DELIVERY_CHARGE_MAX, 'step' => '0.01', 'required' => 'required']], ['free_delivery_min_order', 'Free delivery when the order is at least (৳, leave empty for never)', 'number', ['min' => 1, 'max' => 9999999999.99, 'step' => '0.01']], ['google_login_enabled', 'Google login (also needs GOOGLE_CLIENT_ID in .env)', 'checkbox', ['default' => true]], ['facebook_login_enabled', 'Facebook login (also needs FACEBOOK_CLIENT_ID in .env)', 'checkbox', ['default' => true]], ['guest_checkout_enabled', 'Guest checkout (off: shoppers must sign in to order)', 'checkbox', ['default' => true]], ['phone_required', 'Phone number required to place an order', 'checkbox', ['default' => true]], ]], 'sms' => ['SMS', 'bi-phone', [ ['enabled', 'Send order status SMS to customers', 'checkbox'], ['provider', 'SMS company (log = testing, writes to the log instead of sending)', 'select', \App\Services\Integrations\SmsService::PROVIDERS], ['api_key', 'API key / API token', 'secret'], ['sender_id', 'Sender ID (letters and numbers only)', 'text', ['maxlength' => 20, 'pattern' => '[A-Za-z0-9]+']], ]], ]; $gateways = ['sslcommerz' => 'SSLCommerz', 'bkash' => 'bKash', 'nagad' => 'Nagad']; @endphp
@foreach ($sections as $key => [$title, $icon, $fields])
$loop->first]) role="tabpanel" aria-label="{{ $title }}">

{{ $title }}

@csrf @method('PUT') @foreach ($fields as $field) @include('admin.settings.partials.field', ['section' => $key, 'name' => $field[0], 'label' => $field[1], 'type' => $field[2] ?? 'text', 'options' => $field[3] ?? []]) @endforeach @if ($key === 'storefront') @php($subDistricts = (array) ($settings['storefront']['sub_dhaka_districts'] ?? []))
Sub-Dhaka districts

Dhaka city areas are always Inside Dhaka, and the rest of Dhaka district (Savar, Keraniganj, Dhamrai, Dohar, Nawabganj) is always Sub-Dhaka. Tick any other district that should pay the Sub-Dhaka charge; the rest pay the outside charge.

{{-- Sent empty when nothing is ticked, so clearing every box is saved too. --}}
@foreach (\App\Services\CheckoutService::subDhakaChoices() as $district)
@endforeach
@error('sub_dhaka_districts')
{{ $message }}
@enderror @error('sub_dhaka_districts.*')
{{ $message }}
@enderror
@endif @if ($key === 'payments')

Secrets are encrypted when saved. Leave a masked field as it is to keep the stored value.

@foreach ($gateways as $gateway => $gatewayName)
{{ $gatewayName }} @include('admin.settings.partials.field', ['section' => 'payments', 'name' => "{$gateway}.enabled", 'label' => "Enable {$gatewayName}", 'type' => 'checkbox']) @include('admin.settings.partials.field', ['section' => 'payments', 'name' => "{$gateway}.sandbox_mode", 'label' => 'Sandbox mode', 'type' => 'checkbox']) @include('admin.settings.partials.field', ['section' => 'payments', 'name' => "{$gateway}.store_id", 'label' => 'Store ID']) @include('admin.settings.partials.field', ['section' => 'payments', 'name' => "{$gateway}.public_key", 'label' => 'Public key']) @include('admin.settings.partials.field', ['section' => 'payments', 'name' => "{$gateway}.secret_key", 'label' => 'Secret key', 'type' => 'secret']) @include('admin.settings.partials.field', ['section' => 'payments', 'name' => "{$gateway}.webhook_secret", 'label' => 'Webhook secret', 'type' => 'secret'])
@endforeach
Cash on Delivery (COD) @include('admin.settings.partials.field', ['section' => 'payments', 'name' => 'cod.enabled', 'label' => 'Enable COD', 'type' => 'checkbox'])
@endif
@if ($key === 'email')

Send Test Email

@csrf
$errors->has('recipient_email')])>
@endif @if ($key === 'sms')

Send Test SMS

Save the settings above first. With the log provider the SMS goes to the dated integrations log in storage/logs (integrations-YYYY-MM-DD.log) instead of a phone.

@csrf
$errors->has('phone')])>
@error('phone')
{{ $message }}
@enderror
@endif
@endforeach