@extends('landingpage::layouts.admin') {{-- Assuming your module has its own admin layout --}} @section('title', 'Theme Settings') @section('module_header_title', 'Landing Page Theme Settings') {{-- Or your layout's equivalent section --}} @section('module_content')

Theme & Analytics Settings

@if(session('success')) @endif
@csrf @method('PUT') {{-- Theme Selection --}}

Theme Selection

@error('landingpage_active_theme')

{{ $message }}

@enderror

This text will appear in the top bar.

@error('top_bar_tagline')

{{ $message }}

@enderror
{{-- Theme Color Settings --}}

Theme Colors

Enter HEX (e.g., #FF0000) or RGBA (e.g., rgba(255,0,0,0.5)) values.

@php $colorFields = [ 'Light Mode' => [ 'top_bar_bg_light' => 'Top Bar Background', 'top_bar_text_light' => 'Top Bar Text', 'header_bg_light' => 'Header Background', 'header_text_light' => 'Header Text', 'accent_color_light' => 'Accent Color', ], 'Dark Mode' => [ 'top_bar_bg_dark' => 'Top Bar Background', 'top_bar_text_dark' => 'Top Bar Text', 'header_bg_dark' => 'Header Background', 'header_text_dark' => 'Header Text', 'accent_color_dark' => 'Accent Color', ] ]; @endphp
@foreach($colorFields as $mode => $fields)

{{ $mode }}

@foreach($fields as $key => $label)
@error($key)

{{ $message }}

@enderror
@endforeach
@endforeach

Contact & Social Settings

@error('contact_email')

{{ $message }}

@enderror

This email will be displayed in the top bar and footer.

@error('whatsapp_number')

{{ $message }}

@enderror

Enter the full WhatsApp number including country code (e.g., +12345678900). Leave blank to disable the WhatsApp widget.

@error('whatsapp_default_message')

{{ $message }}

@enderror

This message will be pre-filled when a user clicks the WhatsApp button.


Social Media Links

@php $socialFields = [ 'social_facebook_url' => 'Facebook URL', 'social_linkedin_url' => 'LinkedIn URL', 'social_youtube_url' => 'YouTube URL', 'social_twitter_url' => 'Twitter (X) URL', 'social_tiktok_url' => 'TikTok URL', 'social_instagram_url' => 'Instagram URL', ]; @endphp
@foreach($socialFields as $key => $label)
@error($key)

{{ $message }}

@enderror
@endforeach
{{-- Site Identity Card (New) --}}

Site Identity & SEO Defaults

{{-- Site Name, Description, Keywords, Logo, Favicon, OG Image --}} {{-- These fields are already present in your app.blade.php logic, so we'd add inputs for them here --}} {{-- Example for Site Name: --}}
@error('site_name')

{{ $message }}

@enderror
{{-- Add other fields like site_description, site_logo_upload, site_favicon_upload, site_og_image_upload etc. --}}

Note: Logo, Favicon, and Default OG Image uploads would require file handling logic in the controller.

{{-- Google Analytics Settings --}}

Google Analytics Settings

Enter your GA4 Measurement ID.

Required for fetching statistics from GA4.

Absolute path to your Google Service Account JSON key file. Store this file securely (e.g., in storage/app/google-analytics/ and add to .gitignore).

{{-- How-to Guide for Google Analytics Setup --}}

How to Set Up Google Analytics API Access:

  1. Google Cloud Project: Go to the Google Cloud Console. Create a new project or select an existing one.
  2. Enable API: In your Google Cloud Project, navigate to "APIs & Services" → "Library". Search for and enable the "Google Analytics Data API".
  3. Create Service Account: Go to "IAM & Admin" → "Service Accounts". Click "Create Service Account". Give it a name (e.g., "Website Analytics Reader"). Grant it the "Analytics Reader" role (under "Analytics" roles). You can refine permissions later if needed.
  4. Create JSON Key: After creating the service account, click on its email address. Go to the "Keys" tab. Click "Add Key" → "Create new key". Choose "JSON" and click "Create". A JSON file will download.
  5. Add Service Account to GA4: In your Google Analytics 4 Property, go to "Admin" (bottom left gear icon) → "Property Access Management" (under the Property column). Click the "+" icon to add a new user. Enter the service account's email address (e.g., your-service-account@your-project-id.iam.gserviceaccount.com) and assign it "Viewer" permissions.
  6. Store Credentials & Configure Path: Place the downloaded JSON key file in a secure, non-public location on your server (e.g., storage/app/google-analytics/service-account-credentials.json). Important: Add this directory/file to your .gitignore file (e.g., /storage/app/google-analytics/). Enter the full, absolute path to this JSON file in the "Service Account Credentials JSON Path" field above.
  7. Enter IDs: Fill in your "Google Analytics Measurement ID" (e.g., G-XXXXXXXXXX) and "Google Analytics Property ID" (the numeric ID for your GA4 property) in the fields above.
@endsection