@foreach ($sections as $section) @if ($section->key == 'projects')

{{$section->name}}

@endif @endforeach
@foreach ($projects as $project) @php $beforeImage = $project->images->get(0); $beforeImageUrl = $beforeImage ? $beforeImage->image_url : $project->image_path; $afterImage = $project->images->get(1); $afterImageUrl = $afterImage ? $afterImage->image_url : $project->image_path; @endphp
Before After

{{$project->name}}

@endforeach
{{--
@foreach ($sections as $section) @if ($section->key == 'projects')
{{ $section->name }}

{{ $section->title }}

{{ $section->short_desc }}

@endif @endforeach
@foreach ($projects as $project) @php $firstImage = $project->images->first(); $imageUrl = $firstImage ? $firstImage->image_url : $project->image_path; @endphp @endforeach
--}}