@props([
'blockData',
'contentBlocks' => collect([]),
'prefixName',
'index' => '${index}',
'contentModel' => null,
])
@php
use App\Enums\Content\BlockType;
@endphp
@php
// 枠内の項目を取得
$innerBlocks = $blockData['inner_blocks'] ?? [];
// 枠内の name 付与のためにcountを取得
$innerBlockCount = count($innerBlocks);
@endphp
{{-- 枠内ブロックエリア --}}
@foreach ($innerBlocks as $innerIndex => $innerBlock)
@if ($innerBlock['block_type'] instanceof BlockType)
@php($innerBlockType = $innerBlock['block_type'])
@else
@php($innerBlockType = BlockType::tryFrom($innerBlock['block_type']))
@if ($innerBlockType === null)
@continue
@endif
@endif
@php($innerPrefixName = "{$prefixName}[inner_blocks][$innerIndex]")
@php($innerContentBlock = $contentBlocks->firstWhere('block_type', $innerBlockType))
@endforeach
{{-- 枠内ブロック追加ボタン --}}
枠内にブロック項目を追加