@php // ── Check if we're on a tenant context ── $tenant = request()->get('current_tenant') ?? (isset($currentTenant) ? $currentTenant : null); $isTenantContext = $tenant !== null; // ── Get settings based on context ── if ($isTenantContext) { $tenantSettings = \App\Models\TenantSetting::getAllForTenant($tenant->id); $settings = $tenantSettings; $settings['tenant_name'] = $tenant->name; $settings['is_tenant'] = true; $pageTitle = 'Tenant Settings'; $pageSubtitle = 'Manage settings for ' . $tenant->name . ''; $breadcrumbActive = 'Tenant Settings'; $updateRoute = route('admin.settings.update', ['tenant' => $tenantSlug ?? request()->route('tenant')]); $backUrl = route('admin.dashboard', ['tenant' => $tenantSlug ?? request()->route('tenant')]); } else { $platformSettings = \App\Models\Setting::getAllAsArray(); $settings = $platformSettings; $settings['is_tenant'] = false; $pageTitle = 'Platform Settings'; $pageSubtitle = 'Manage platform-wide settings'; $breadcrumbActive = 'Platform Settings'; $updateRoute = route('admin.settings.update'); $backUrl = route('admin.dashboard'); } @endphp @include('Partials.sidebar')
@include('Partials.header')

{{ $pageTitle }}

@if($isTenantContext) {{ $tenant->name }} @endif
  1. ›
  2. {{ $breadcrumbActive }}
@if(session('success'))
{{ session('success') }}
@endif @if(session('error'))
{{ session('error') }}
@endif
Currency Settings @if($isTenantContext) (Tenant-specific) @else (Platform-wide) @endif
@csrf @method('PUT')
@error('currency_symbol')
{{ $message }}
@enderror
@error('currency_code')
{{ $message }}
@enderror
@error('currency_position')
{{ $message }}
@enderror
{{-- Live preview --}}
Preview: ₹ 50,00,000
{{-- ── Quick Info Card ── --}}
{{ $isTenantContext ? 'Tenant Information' : 'Platform Information' }}
@if($isTenantContext)
{{ strtoupper(substr($tenant->name, 0, 1)) }}
{{ $tenant->name }}
{{ $tenant->email }}

Tenant ID #{{ $tenant->id }}
Status {{ ucfirst($tenant->status) }}
Plan {{ $tenant->plan->name ?? 'N/A' }}
Created {{ $tenant->created_at?->format('d M Y, h:i A') }}
@else
Platform Settings

Manage global platform settings that apply to all tenants.


Total Tenants {{ \App\Models\Tenant::count() }}
Active Tenants {{ \App\Models\Tenant::where('status', 'active')->count() }}
Total Admins {{ \App\Models\Admin::count() }}
Total Plans {{ \App\Models\Plan::count() }}
@endif
{{-- ── Currency API Info ── --}}
API Endpoint
Currency API @if($isTenantContext) /api/tenant/{{ $tenant->slug }}/currency @else /api/admin/currency @endif
@include('Partials.footer')