@php $categoriesRequest ??= []; $activeCategoryId ??= 0; if (!isset($groupedCategories)) { $groupedCategories = $categories->groupBy('parent_id'); } $currentCategories = $groupedCategories->get($parentId ?? 0); @endphp @if($currentCategories) @foreach ($currentCategories as $category)