Skip to content

Commit

Permalink
add new function: sequence()
Browse files Browse the repository at this point in the history
  • Loading branch information
uyab committed Dec 25, 2015
1 parent 5ceb0fb commit 84b8325
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/Pagination/SemanticUiPagination.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public function summary()
$to = $total;
}

if($total > 0) {
if ($total > 0) {
return trans('support::pagination.summary', compact('from', 'to', 'total'));
}

Expand All @@ -62,4 +62,13 @@ public function pager()

return trans('support::pagination.pager', compact('page', 'total'));
}

public function sequence($item)
{
$collections = collect($this->paginator->items());
$index = $collections->search($item) + 1;
$start = (request('page', 1) - 1) * $this->paginator->perPage();

return $start + $index;
}
}

0 comments on commit 84b8325

Please sign in to comment.