@foreach($blocks as $data)
@php
$position = $data->position;
$json = $data->json ?? [];
$imageSource = null;
if (!empty($json['is_image'])) {
if (!empty($json['image_absolute_path']) && file_exists($json['image_absolute_path'])) {
$imageSource = $json['image_absolute_path'];
} elseif (!empty($json['image_path']) && \Illuminate\Support\Facades\Storage::disk('public')->exists($json['image_path'])) {
$imageSource = \Illuminate\Support\Facades\Storage::disk('public')->path($json['image_path']);
} elseif (!empty($json['image_url'])) {
$imageSource = $json['image_url'];
}
}
@endphp
@if(!empty($json['is_image']) && $imageSource)

@else
{!! $json['content'] ?? '' !!}
@endif
@endforeach
@endforeach
@if(empty($blocksByPage))