@php $limit = 10; $orderBy = 'asc'; if (isset($singelWidgetData->widget_content)) { $widgetContent = $singelWidgetData->getTranslation('widget_content'); $limit = isset($widgetContent['total_display_categories']) ? $widgetContent['total_display_categories'] : 10; $orderBy = isset($widgetContent['category_order_type']) ? $widgetContent['category_order_type'] : 'asc'; } $categoryList = \App\Models\Category::getAllCategory($limit, $orderBy); $countCategory = count($categoryList); if ($countCategory > 6) { $countCategory = 3; } @endphp @if ($categoryList->count() > 0)
@foreach ($categoryList as $category) @endforeach
@endif