@extends('central.super.layout') @section('title', __('super.tenants.tenant') . ' ' . $tenant->id) @section('content')
{{-- Tenant details --}}

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

  • {{ __('super.tenants.tenant_id') }} {{ $tenant->id }}
  • {{ __('super.common.status') }} {{ ucfirst($tenant->status) }}
  • {{ __('super.tenants.plan') }} @if($tenant->subscription?->plan) {{ $tenant->subscription->plan->name }} — ${{ number_format($tenant->subscription->plan->price, 2) }}/{{ __('super.plans.mo') }} @else {{ __('super.tenants.no_plan') }} @endif
  • {{ __('super.tenants.subscription') }} @if($tenant->subscription) {{ ucfirst($tenant->subscription->status) }} @else {{ __('super.tenants.no_subscription') }} @endif
  • @if($tenant->subscription?->trial_ends_at)
  • {{ __('super.tenants.trial_ends') }} {{ $tenant->subscription->trial_ends_at->format('M d, Y') }} @if($tenant->subscription->trial_ends_at->isFuture()) {{ $tenant->subscription->trial_ends_at->diffForHumans() }} @else {{ __('super.tenants.expired') }} @endif
  • @endif @if($tenant->locale)
  • {{ __('central.EmailLanguage') }} {{ strtoupper($tenant->locale) }}
  • @endif
  • {{ __('super.tenants.created') }} {{ $tenant->created_at->format('M d, Y \a\t h:i A') }}
  • @if($tenant->updated_at && $tenant->updated_at->ne($tenant->created_at))
  • {{ __('super.tenants.last_updated') }} {{ $tenant->updated_at->format('M d, Y \a\t h:i A') }}
  • @endif
{{-- Plan limits & features --}} @if($tenant->subscription?->plan) @php $plan = $tenant->subscription->plan; @endphp

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

{{ __('super.tenants.edit_plan') }}
{{-- Limits with usage --}}
@foreach($plan->getFormattedLimits() as $key => $lim) @php $current = $usageStats[$key] ?? null; $max = $lim['value']; $isUnlimited = $max < 0; $percentage = (!$isUnlimited && $max > 0 && $current !== null) ? min(100, round(($current / $max) * 100)) : 0; $isNearLimit = $percentage >= 80; $isAtLimit = $percentage >= 100; @endphp
{{ $lim['label'] }} @if($current !== null && !$isUnlimited) {{ number_format($current) }}/{{ $lim['display'] }} @elseif($current !== null && $isUnlimited) {{ number_format($current) }} / @elseif($isUnlimited) @else {{ $lim['display'] }} @endif
@if(!$isUnlimited && $current !== null && $max > 0)
@endif
@endforeach
{{-- Features --}} @php $activeFeatures = $plan->getActiveFeatures(); @endphp
@foreach(\App\Models\Central\Plan::AVAILABLE_FEATURES as $fKey => $fMeta) @php $enabled = $plan->hasFeature($fKey); @endphp
{{ $fMeta['label'] }}
@endforeach
@endif
{{-- Domains --}}

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

{{ $tenant->domains->count() }} {{ Str::plural(__('central.DomainWord'), $tenant->domains->count()) }}
@if($tenant->domains->isNotEmpty())
@foreach($tenant->domains as $d) @php $fullDomain = str_contains($d->domain, '.') ? $d->domain : $d->domain . '.' . (parse_url(config('app.url', 'http://localhost'), PHP_URL_HOST) ?? 'localhost'); @endphp
{{ $fullDomain }} @if(!str_contains($d->domain, '.')) {{ __('central.SubdomainLabel') }}: {{ $d->domain }} @endif
{{ __('super.common.active') }} @if($tenant->domains->count() > 1)
@csrf @method('DELETE')
@endif
@endforeach
@if(\App\Models\Central\GeneralSetting::instance()->isSharedHosting())

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

@endif @else

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

@endif {{-- Add subdomain form --}} @php $baseDomain = parse_url(config('app.url', 'http://localhost'), PHP_URL_HOST) ?? 'localhost'; @endphp
@csrf
.{{ $baseDomain }}
{{-- Custom Domains --}} @php $customDomainVerifier = app(\App\Services\CustomDomainVerifier::class); $centralHost = $customDomainVerifier->centralHost(); @endphp

{{ __('super.custom_domains.title') }}

{{ $tenant->customDomains->count() }}

{{ __('super.custom_domains.subtitle') }}

@if($tenant->customDomains->isNotEmpty())
@foreach($tenant->customDomains as $cd)
{{ $cd->domain }}
@if($cd->is_verified) {{ __('super.custom_domains.status_verified') }} @else {{ __('super.custom_domains.status_pending') }} @endif @if($cd->is_primary) {{ __('super.custom_domains.primary_badge') }} @endif {{ __('super.custom_domains.ssl_' . $cd->ssl_status) }} {{ __('super.custom_domains.last_check') }}: {{ $cd->last_check_at ? $cd->last_check_at->diffForHumans() : __('super.custom_domains.never_checked') }}
@if(!$cd->is_verified && $cd->last_check_error)
{{ $cd->last_check_error }}
@endif
@if(!$cd->is_verified) @elseif(!$cd->is_primary)
@csrf
@endif
@csrf @method('DELETE')
@endforeach
{{-- DNS instructions accordion --}}
{{ __('super.custom_domains.dns_instructions_title') }}

{{ __('super.custom_domains.dns_intro') }}

    @foreach($tenant->customDomains as $cd) @continue($cd->is_verified)
  • {{ $cd->domain }}
    {{ __('super.custom_domains.dns_cname_label') }}: {{ __('super.custom_domains.dns_cname_value', ['host' => $centralHost]) }}
    {{ __('super.custom_domains.dns_a_label') }}: {{ __('super.custom_domains.dns_a_value', ['host' => $centralHost]) }}
    {{ __('super.custom_domains.dns_txt_label') }}: {{ __('super.custom_domains.dns_txt_value', ['domain' => $cd->domain, 'token' => $cd->verification_token]) }}
  • @endforeach

{{ __('super.custom_domains.ssl_hint') }}

@endif {{-- Add form --}}
@csrf
@error('domain')
{{ $message }}
@enderror
{{-- Approve & Provision (visible only for PENDING tenants) --}} @if($tenant->isPending()) @php $approvePlan = $tenant->subscription?->plan; $approveIsFreeOrTrial = $approvePlan && ($approvePlan->isFree() || $approvePlan->hasTrial()); $approveHasPaidPayment = $tenant->payments()->where('status', 'paid')->exists(); $approveCanApprove = $approveIsFreeOrTrial || $approveHasPaidPayment; $approveIsShared = \App\Models\Central\GeneralSetting::instance()->isSharedHosting(); @endphp

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

@if(! $approveCanApprove)

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

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

@else
@csrf @if($approveIsFreeOrTrial)

{{ $approvePlan->isFree() ? __('central.FreePlanNoPayment') : __('central.TrialPlanDaysFree', ['days' => $approvePlan->getTrialDays()]) }}

@else

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

@endif @php $defaultDbHost = $approveIsShared ? 'localhost' : config('database.connections.central.host', '127.0.0.1'); $defaultDbUser = $approveIsShared ? '' : config('database.connections.central.username', 'root'); $defaultDbPassword = $approveIsShared ? '' : config('database.connections.central.password', ''); $defaultDbPort = $approveIsShared ? 3306 : (int) config('database.connections.central.port', 3306); $defaultDbName = $approveIsShared ? 'tenant_' . ($tenant->domains->first()->domain ?? '') : config('tenancy.database.prefix', 'tenant') . $tenant->id . config('tenancy.database.suffix', ''); @endphp

@if($approveIsShared) {!! __('central.SharedHostingDbHint') !!} @else {!! __('central.VpsDbHint') !!} @endif

@endif
@endif {{-- Admin Actions (only for provisioned tenants) --}} @if(in_array($tenant->status, ['active', 'suspended', 'cancelled']))

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

{{-- Re-run Migrations --}}
@csrf
{{-- Re-seed --}}
@csrf
{{-- Re-provision (Full Re-install) --}}
@csrf
{{-- Reset Database (Drop & Migrate) --}}
@csrf
@endif {{-- Database Configuration (only for provisioned tenants) --}} @if(in_array($tenant->status, ['active', 'suspended', 'cancelled'])) @php $dbCreds = $tenant->getEffectiveDatabaseCredentials(); $isCustomCreds = $tenant->hasDatabaseCredentials(); @endphp

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

{{-- Credential source indicator --}}
@if($isCustomCreds) {{ __('central.AdminConfiguredShared') }} @else {{ __('central.AutoProvisionedVps') }} @endif
{{-- Read-only view --}}
{{-- Edit Database Credentials (separate card, toggled from the Database Configuration card) --}} @endif {{-- Users --}}

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

{{ __('central.ViewAll', ['count' => $tenantUserCount]) }}
@if(count($tenantUsers) > 0)
@foreach($tenantUsers as $tUser) @endforeach
# {{ __('central.UserCol') }} {{ __('central.EmailCol') }} {{ __('central.Role') }} {{ __('central.StatusCol') }} {{ __('central.Action') }}
{{ $tUser->id }}
{{ $tUser->firstname }} {{ $tUser->lastname }} @if((int) $tUser->id === 1) {{ __('central.Owner') }} @endif
{{ $tUser->email }} @php $role = $tUser->roles->first(); @endphp @if($role) {{ $role->name }} @else @endif @if($tUser->statut) {{ __('central.Active') }} @else {{ __('central.Blocked') }} @endif @if($tUser->statut)
@csrf
@else
@csrf
@endif
@if($tenantUserCount > 5) @endif @else

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

@endif
{{ __('super.tenants.back_to_tenants') }}
@push('scripts') @endpush @endsection