Not sure how did it reset/s itself even though it's inside the foreach loop. Here's a snippet from of my blade view:
<tbody>
<?php $counter = 1; ?>
@foreach ($guidelines as $guideline)
<tr>
<td class="text-center">{{ $counter }}</td>
<td>{{ $guideline->description }}</td>
<td>
<a href="/general-guidelines/{{ $guideline->id }}/edit" class="btn btn-warning btn-sm"><i class="far fa-edit"></i></a>
<button type="button" class="btn btn-danger btn-sm" data-toggle="modal" data-target="#myModal"><i class="far fa-trash-alt"></i></button>
<div class="modal fade" id="myModal" role="dialog">
<div class="modal-dialog modal-sm">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">Confirm Delete</h4>
</div>
<div class="modal-body">
<p>Are you sure you want to delete this?</p>
</div>
<div class="modal-footer">
<a href="/general-guidelines/{{ $guideline->id }}/delete" class="btn btn-danger">Confirm</a>
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
</td>
<?php $counter++; ?>
</tr>
@endforeach
</tbody>
Edit works with /general-guidelines/1/edit, /general-guidelines/2/edit, /general-guidelines/5/edit, etc. But /delete would always end up at /1/delete