@extends('central.super.layout') @section('title', __('super.tenants.title')) @php $envDbHost = config('database.connections.central.host', '127.0.0.1'); $envDbPort = config('database.connections.central.port', '3306'); $envDbUser = config('database.connections.central.username', ''); $envDbPass = config('database.connections.central.password', ''); @endphp @section('content')
{{ $tenants->total() }} {{ Str::plural(__('central.TenantWord'), $tenants->total()) }}
@forelse($tenants as $t) @php $displayName = $t->company_name ?? ($t->domains->first()->domain ?? $t->id); $colors = ['purple', 'blue', 'green', 'amber', 'rose']; $color = $colors[crc32($t->id) % count($colors)]; $initial = strtoupper(mb_substr($displayName, 0, 1)); @endphp {{-- DB config form row --}} @if($t->status === 'pending') @else {{-- DB config form row for active/approved tenants --}} @php $existingCreds = $t->getEffectiveDatabaseCredentials(); $isCustomCreds = $t->hasDatabaseCredentials(); @endphp @endif @empty @endforelse
{{ __('super.tenants.tenant') }} {{ __('super.tenants.domains') }} {{ __('super.common.status') }} {{ __('super.tenants.plan') }} {{ __('super.tenants.created') }}
{{ $initial }}

{{ $displayName }}

{{ $t->admin_email ?? ('Created ' . $t->created_at->diffForHumans()) }}

@if($t->domains->isNotEmpty()) @foreach($t->domains->take(2) as $d) {{ $d->domain }} @endforeach @if($t->domains->count() > 2) +{{ $t->domains->count() - 2 }} {{ __('super.common.more') }} @endif @else @endif {{ ucfirst($t->status) }} @if($t->subscription?->plan) {{ $t->subscription->plan->name }} @else @endif {{ $t->created_at->format('M d, Y') }}
@if($t->status === 'pending') @else {{ __('super.common.view') }} @endif
{{ __('central.DatabaseConfigFor', ['name' => $t->company_name ?? $t->id]) }}
@csrf {{-- Subdomain reminder for shared hosting --}} @if(\App\Models\Central\GeneralSetting::instance()->isSharedHosting()) @php $subdomainName = $t->domains->first()->domain ?? null; @endphp @if($subdomainName)

{{ __('central.SubdomainSetupRequired') }}

{{ __('central.SubdomainSetupDesc') }}

{{ $subdomainName }}.{{ parse_url(config('app.url', 'http://localhost'), PHP_URL_HOST) ?? 'localhost' }}
@endif @endif
{{ __('central.DbNameHint', ['suggestion' => 'tenant_' . ($t->domains->first()->domain ?? 'name')]) }}
{{ __('central.DatabaseConfigFor', ['name' => $displayName]) }}
@if($isCustomCreds) {{ __('central.AdminConfigured') }} @elseif($existingCreds) {{ __('central.AutoProvisioned') }} @else {{ __('central.NotConfigured') }} @endif

{{ __('central.ActiveTenantDbWarning') }}

@csrf @method('PUT') {{-- Subdomain info for shared hosting --}} @if(\App\Models\Central\GeneralSetting::instance()->isSharedHosting()) @php $subdomainName = $t->domains->first()->domain ?? null; @endphp @if($subdomainName)

{{ __('central.SubdomainLabel') }}: {{ $subdomainName }}.{{ parse_url(config('app.url', 'http://localhost'), PHP_URL_HOST) ?? 'localhost' }} — {{ __('central.EnsureSubdomainExists') }}

@endif @endif

{{ __('super.tenants.no_tenants') }}

{{ __('super.tenants.no_tenants_desc') }}

@if($tenants->hasPages())
{{ $tenants->links('vendor.pagination.bootstrap-5') }}
@endif {{-- Reject Modal --}} @if($tenants->contains('status', 'pending'))

{{ __('central.RejectTenant') }}

@csrf
@endif @push('scripts') @endpush @endsection