@php
if(array_has($sub, 'layout')) {
$layout = $sub->layout;
} else {
$layout = 'left';
}
if($layout === 'column') {
$columns = 2;
$col = "col-md-6";
} elseif ($layout === 'project-gallery') {
$columns = 2;
$col = "col-md-6";
} elseif ($layout === 'image-text-description') {
$columns = 3;
$col = "col-md-4 pb-3 pb-md-0 p-3";
}
@endphp
@if(isset($sub->subcomponents))
@foreach($sub->subcomponents->chunk($columns) as $chunk)
@foreach($chunk as $subitem)
@if($layout === 'column')
@include('componentimagelink::layouts.column')
@elseif($layout === 'project-gallery')
@include('componentimagelink::layouts.project-gallery')
@elseif($layout === 'image-text-description')
@include('componentimagelink::layouts.image-text-description')
@endif
@endforeach
@endforeach
@endif