@props([ /** * Array of breadcrumb items in the form: * [ ['label' => 'Dashboard', 'url' => route('admin.dashboard')], ['label' => 'Games', 'active' => true] ] * If 'active' is set, that item gets the active class; otherwise the last item is active by default. */ 'items' => [], /** * Page title below the breadcrumb */ 'title' => null, /** * Optional CSS classes for the wrapper */ 'class' => '', ]) @php // Determine active index: first item with 'active' truthy, else last $activeIndex = null; foreach ($items as $idx => $item) { if (isset($item['active']) && $item['active']) { $activeIndex = $idx; break; } } if ($activeIndex === null) { $activeIndex = count($items) - 1; } @endphp
@if($title)

{{ $title }}

@endif