@php $text = $article->content_json; if (strlen($text) > 0) { $objects = json_decode($text); } else { $objects = []; } $count = 0; @endphp @if ($article->tableOfContent == '1') @if (count($objects) > 0)
Table of contents
@foreach ($objects as $k => $obj)
@if ($obj->name == 'h2') @php $count++; @endphp
{{ $obj->value }}
@elseif($obj->name == 'h3')
{{ $obj->value }}
@endif
@endforeach
@endif @endif
@if (!App\Helpers\Helper::isMobileDev()) @else @endif