@php $components = $this->getRegisteredCustomProfileComponents(); // Groups the page into named zones instead of one flat stack of nine // cards (the "je ne trouve rien" complaint) — each zone renders in the // fixed order below. Component keys not listed here (a future // `customProfileComponents()` addition) fall through to the "Autres" // catch-all so nothing silently disappears from the page. $zones = [ [ 'title' => 'Profil', 'description' => "Ton identité, ta photo et tes préférences d'affichage.", 'anchor' => 'profil', 'keys' => ['account_identity', 'edit_profile_form'], ], [ 'title' => 'Mes espaces', 'description' => "Le rôle et l'adresse de contact que les autres membres voient dans chacun de tes espaces.", 'anchor' => 'espaces', 'keys' => ['workspace_memberships'], ], [ 'title' => 'Personnalisation', 'description' => "Personnaliser l'expérience Joseph... ooouuuh...!", 'anchor' => 'personnalisation', 'keys' => ['custom_fields_form'], ], [ 'title' => 'Sécurité', 'description' => 'Mot de passe, connexion à deux facteurs, jetons API et sessions actives.', 'anchor' => 'security', 'keys' => ['edit_password_form', 'multi_factor_authentication', 'sanctum_tokens'], ], [ 'title' => 'Navigateurs connectés', 'description' => 'Vous êtes plutôt du genre à vous connecter à plein d\'endroit différents ou non ?', 'anchor' => 'browser', 'keys' => ['browser_sessions_form'], ], ]; $zoned = collect($zones)->flatMap(fn(array $zone) => $zone['keys'])->all(); $remaining = collect($components) ->keys() ->diff($zoned) ->diff(['delete_account_form']) ->all(); @endphp
@foreach ($zones as $zone) @php $zoneComponents = collect($zone['keys'])->filter(fn(string $key) => isset($components[$key])); @endphp @if ($zoneComponents->isNotEmpty())

{{ $zone['title'] }}

{{ $zone['description'] }}

@foreach ($zoneComponents as $key) @livewire($components[$key]) @endforeach
@endif @endforeach @if (!empty($remaining))
@foreach ($remaining as $key) @livewire($components[$key]) @endforeach
@endif @if (isset($components['delete_account_form']))

Zone dangereuse

Cette action est irréversible.

@livewire($components['delete_account_form'])
@endif