@foreach($tabs as $tab) @php($label = is_array($tab) ? ($tab['label'] ?? 'Onglet') : (string) $tab) @php($routeName = is_array($tab) ? ($tab['route'] ?? null) : (is_string($tab) ? $tab : null)) @php($active = $routeName ? request()->routeIs($routeName) : false) @php($hasRoute = $routeName ? \Illuminate\Support\Facades\Route::has($routeName) : false) @if($hasRoute) {{ $label }} @else {{ $label }} @endif @endforeach