Hiérarchie des pages
@php $isChild = !empty($landingWebsite->parent_id); $parent = $isChild ? $landingWebsite->parent : null; $children = $isChild ? ($parent->children ?? collect()) : $landingWebsite->children; @endphp {{-- Parent section (only if current page is a child) --}} @if($isChild && $parent)
Page parente
{{ $parent->id }} {{ $parent->name }} {{ config('services.wellpack.website_url_domain') . '/' . $parent->slug }}
@endif {{-- Children/Siblings section --}}
{{ $isChild ? 'Pages sœurs' : 'Pages enfants' }}
@forelse($children as $lw) @empty @endforelse
{{ $lw->id }} {{ $lw->name }} @if($lw->id === $landingWebsite->id) Actuelle @endif {{ config('services.wellpack.website_url_domain') . '/' . $lw->slug }}
Modifier Dupliquer Supprimer
Aucune page {{ $isChild ? 'sœur' : 'enfant' }}
Créer page enfant