@extends("client.layouts.app") @section("title", __('client.hosting.databases.title')) @section("content") @php $domains = collect($groups)->mapWithKeys(fn ($g) => [$g['domain_id'] => $g['domain']]); $totalDbs = collect($groups)->flatMap(fn ($g) => collect($g['users'])->pluck('database_name'))->filter()->unique()->count(); @endphp {{ $service->product?->name ?? __('client.services.title') }}

{{ __('client.hosting.databases.title') }}

{{ __('client.hosting.databases.subtitle') }}
@if(!empty($phpMyAdminUrl)) {{ __('client.hosting.databases.phpmyadmin') }} @endif {{ $totalDbs }} {{ __('client.hosting.databases.title') }}
@if($domains->isEmpty())
{{ __('client.hosting.databases.no_domains') }}
@else {{-- Create database --}}
{{ __('client.hosting.databases.create_title') }}
@csrf
{{-- Databases per domain --}}
{{ __('client.hosting.databases.title') }}
@if($totalDbs === 0)
{{ __('client.hosting.databases.empty') }}
@else @foreach($groups as $g) @php($byDb = collect($g['users'])->groupBy('database_name')) @foreach($byDb as $dbName => $users) @continue($dbName === '')
{{ $dbName }}
{{ __('client.hosting.databases.add_user') }}
@csrf
@csrf
@foreach($users as $u) @endforeach
{{ $u['username'] }}@if($u['is_primary']){{ __('client.hosting.databases.primary') }}@endif {{ $u['role'] }}
{{ __('client.hosting.databases.change_password') }}
@csrf
@unless($u['is_primary'])
@csrf
@endunless
@endforeach @endforeach @endif
@endif @endsection