<li>
    <input type="checkbox"
           name="accounts[]"
           class="account-checkbox {{ isset($account->parent_id) ? 'child-of-' . $account->parent_id : '' }}"
           data-id="{{ $account->id }}"
           value="{{ $account->id }}"
           id="acc{{ $account->id }}">
    <label for="acc{{ $account->id }}">{{ $account->code }} - {{ $account->name }}</label>

    @php
        $children = $accounts->where('parent_id', $account->id);
    @endphp

    @if ($children->count())
        <ul style="list-style: none; padding-left: 20px;">
            @foreach ($children as $child)
                @include('admin.ledger.partials.account-node', ['account' => $child, 'accounts' => $accounts])
            @endforeach
        </ul>
    @endif
</li>
