break foreach laravel
@forelse ($datatabel as $data)
<tr>
<td>{{ $loop->iteration }}</td>
<td>{{ $data->name }}</td>
<td>
<button type="button" class="btn btn-primary">edit</button>
@forelse($data->subcategory as $subcategory)
@if($subcategory->category_id == $data->id)
<button type="button" class="btn btn-success" disabled style="cursor: not-allowed;">In Use</button>
@php break; @endphp {{-- put this --}}
@endif
@empty
<button type="button" class="btn btn-danger">delete</button>
@endforelse
</td>
</tr>
@empty
<tr>
<td colspan="3" class="text-center">No Data Available</td>
</tr>
@endforelse