fix(master-rule): fix table rule

This commit is contained in:
arieeefajar 2025-04-28 15:31:45 +07:00
parent eefa91898f
commit 5f8ef6c199
2 changed files with 5 additions and 9 deletions

View File

@ -13,8 +13,6 @@ class RuleController extends Controller
public function index()
{
$indicators = Indicator::with('rules')->get();
// $indicators = Indicator::select('id', 'name')->get();
// dd($indicators);
return view('master-data.aturan.index', compact('indicators'));
}

View File

@ -140,17 +140,15 @@ class="fw-medium link-primary">#VZ2101</a>
<th class="sort" data-sort="action">Action</th>
</tr>
</thead>
@php
$no = 1; // Mulai dari 1, counter global
@endphp
<tbody class="list form-check-all">
@foreach ($indicators as $indicator)
@foreach ($indicator->rules as $index => $rule)
<tr class="text-center">
@if ($index === 0)
<td rowspan="{{ $indicator->rules->count() }}">
{{ $loop->iteration }}</td>
<td class="indicator"
rowspan="{{ $indicator->rules->count() }}">
{{ $indicator->name }}</td>
@endif
<td class="no">{{ $no++ }}</td>
<td class="indicator">{{ $indicator->name }}</td>
<td class="id" style="display: none">
<a href="javascript:void(0);"
class="fw-medium link-primary">#VZ2101</a>