@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($domains->isEmpty())
{{ __('client.hosting.databases.no_domains') }}
@else
{{-- Create database --}}
{{ __('client.hosting.databases.create_title') }}
{{-- 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') }}
@foreach($users as $u)
| {{ $u['username'] }}@if($u['is_primary']){{ __('client.hosting.databases.primary') }}@endif |
{{ $u['role'] }} |
{{ __('client.hosting.databases.change_password') }}
@unless($u['is_primary'])
@endunless
|
@endforeach
@endforeach
@endforeach
@endif
@endif
@endsection