<table class="table table-bordered">
    <thead>
        <tr>
            <th>Komoditi<br><small>Commodity</small></th>
            <th>Jenis tanaman<br><small>Crop</small></th>
            <th>Keluasan bertanam (ha)<br><small>Planted area (ha)</small></th>
        </tr>
    </thead>
    <tbody>
        @php
            $crops = [
                'fruits' => 24,
                'vegetables' => 25,
                'paddy' => 26,
                'others' => 27,
            ];
        @endphp

        @foreach ($crops as $crop => $questionId)
            <tr>
                <td>{{ ucfirst($crop) }}<br><small>{{ ucfirst($crop) }}</small></td>
                <td>
                    <input type="text" name="answers[{{ $questionId }}][crop]" class="form-control"
                        placeholder="Jenis tanaman" value="{{ old('answers.' . $questionId . '.crop') }}" required>
                </td>
                <td>
                    <input type="number" name="answers[{{ $questionId }}][area]" class="form-control"
                        placeholder="Keluasan bertanam (ha)" value="{{ old('answers.' . $questionId . '.area') }}" required>
                </td>
            </tr>
        @endforeach
    </tbody>
</table>
<div class="form-group mt-3">
    <label for="total_area_{{ $crops['fruits'] }}">Jumlah Keluasan Ladang Bertanam (ha):</label>
    <input type="number" name="answers[28][total_area]" id="total_area_{{ $crops['fruits'] }}" class="form-control"
           value="{{ old('answers.28.total_area') }}" placeholder="Total planted area (ha)">
</div>
