@extends('layouts.shell') @section('title', 'Settings') @php $byKey = collect($settings)->keyBy('key'); $creditOffers = \App\Services\CreditPackageService::normalizeList( old('settings.credit_packages', $byKey['credit_packages']['value'] ?? []), (int) ($byKey['credit_price_pkr']['value'] ?? 100), ); if ($creditOffers === []) { $creditOffers = \App\Services\CreditPackageService::defaultPackages(); } @endphp @section('content')
@csrf @method('PUT')

Credit offers

These packs appear on the app Wallet page. Set credits and the JazzCash amount for each offer. Example: 5 credits for Rs 500, 20 credits for Rs 1800.

@foreach ($creditOffers as $index => $offer)
@endforeach
@error('settings.credit_packages'){{ $message }}@enderror

General

@foreach ($settings as $setting) @if ($setting['key'] === 'credit_packages') @continue @endif @php $name = 'settings['.$setting['key'].']'; $labels = [ 'support_phone' => 'Support Call Number', 'support_whatsapp' => 'Support WhatsApp Number', 'credit_price_pkr' => 'Default PKR per credit', 'jazzcash_account_title' => 'JazzCash account title', 'jazzcash_account_number' => 'JazzCash number', 'payment_instructions' => 'Wallet payment instructions', 'show_tournaments_tab' => 'Show Tournaments in the bottom menu', 'show_events_tab' => 'Show Events in the bottom menu', 'show_offers_in_header' => 'Show Offers in Header', 'metal_price_enabled' => 'Metal price updates', 'metal_price_url' => 'Metal Price API URL', 'metal_feed_access' => 'Metal Price API Key', 'metal_price_base' => 'Base currency', 'metal_price_interval_minutes' => 'Update interval (minutes)', 'gold_countdown_minutes' => 'App countdown (minutes)', 'pathoor_difference_per_tola' => 'Pathoor difference per tola', 'gold_local_notice_enabled' => 'Show local market notice', 'gold_local_notice_min' => 'Minimum difference', 'gold_local_notice_max' => 'Maximum difference', 'gold_local_notice_text' => 'Local market notice text', 'gold_page_brand_category_id' => 'Gold page brand category', 'min_app_version' => 'Minimum app version', 'home_live_poster_count' => 'Live posters on Home', 'home_upcoming_poster_count' => 'Upcoming posters on Home', 'home_event_poster_count' => 'Event posters on Home', ]; $hints = [ 'credit_price_pkr' => 'Used only as a fallback if an old credit pack has no price.', 'support_phone' => 'Call Us on the app Support page uses this number.', 'support_whatsapp' => 'WhatsApp Us on the app Support page uses this number.', 'jazzcash_account_number' => 'Shown on the Wallet page so broadcasters know where to send payment.', 'show_tournaments_tab' => 'Trophy icon. Turn off to hide the Tournaments tab.', 'show_events_tab' => 'Ticket icon. Opens All Events. Turn off to hide this tab.', 'show_offers_in_header' => 'Offers icon next to the Gold Rates icon. Turning this off does not hide a brand\'s own Offers.', 'metal_price_enabled' => 'When this is off, the server keeps the last saved rates and does not call the external API.', 'metal_feed_access' => 'Stored on the server only. It is never sent to the app.', 'metal_price_base' => 'Default PKR. Sent as the base currency on each refresh.', 'metal_price_interval_minutes' => 'How often the server calls the gold API. Default 30. The existing every-minute cron only checks, and skips the API until this time has passed.', 'gold_countdown_minutes' => 'Timer shown in the app. Default 35, so the app says new rates arrive 35 minutes after the last update. This does not change the 30 minute API call.', 'pathoor_difference_per_tola' => 'Pathoor per tola = 24K gold per tola minus this amount. Default 5500.', 'gold_local_notice_min' => 'Admin reference for the local adjustment. The app shows the notice text, not a calculated local price.', 'gold_local_notice_max' => 'Update the notice text if these amounts change.', 'gold_page_brand_category_id' => 'View All on the Gold Rates page opens this parent category. None hides View All.', 'min_app_version' => 'Example 1.0.50. Leave blank for no update popup. Phones on an older version see Update PakSports when they open the app.', 'home_live_poster_count' => 'How many Live posters the home page shows. 0 hides that section. Maximum 12.', 'home_upcoming_poster_count' => 'How many Upcoming posters the home page shows. 0 hides that section. Maximum 12.', 'home_event_poster_count' => 'How many posters each home event section can show. 0 hides those rows. Maximum 12.', ]; $label = $labels[$setting['key']] ?? str_replace('_', ' ', $setting['key']); @endphp @if ($setting['key'] === 'support_phone')

Support — numbers shown on the app Support page. Call and WhatsApp can be different.

@endif @if ($setting['key'] === 'metal_price_enabled')

Gold Rates. The external metal API is called only by the server.

@endif @if ($setting['key'] === 'show_tournaments_tab')

App bottom menu. Both tabs stay on until you turn one off and save.

@endif @if ($setting['key'] === 'home_live_poster_count')

Home posters. These counts apply to the app home page after you save.

@endif @if ($setting['key'] === 'gold_page_brand_category_id') {{ $hints[$setting['key']] }} @elseif ($setting['type'] === 'boolean') @if (! empty($hints[$setting['key']])) {{ $hints[$setting['key']] }} @endif @elseif ($setting['type'] === 'integer') @else @endif @error('settings.'.$setting['key']){{ $message }}@enderror @endforeach
@endsection @push('scripts') @endpush