increment row number with laravel pagination

In Laravel 5.3 you can use firstItem():

@foreach ($items as $key => $value)    
  {{ $items->firstItem() + $key }}
@endforeach

The below works with laravel 5.4

<?php $i = ($telephone->currentpage()-1)* $telephone-
>perpage() + 1;?>
@foreach($telephone as $whatever)
<td> {{ $i++ }}</td>
@endforeach

Edited The below works for laravel 5.7 above

@foreach ($telephone as $key=> $whatever)
  <td>{{ $key+ $telephone->firstItem() }}</td>
@endforeach

You should be able to use the getFrom method to get the starting number of the current pages results. So instead of setting $i = 1; you should be able to do this.

<?php $i = $telephone->getFrom(); ?>

In Laravel 3 there is no getFrom method so you need to calculate it manually.

<?php $i = ($telephone->page - 1) * $telephone->per_page + 1; ?>

Laravel 5.3

@foreach ($products as $key=>$val)
  {{ ($products->currentpage()-1) * $products->perpage() + $key + 1 }}
@endforeach