Skip to content

Commit

Permalink
Add method for set labels in OffsetPagination (#178)
Browse files Browse the repository at this point in the history
Co-authored-by: Sergei Predvoditelev <[email protected]>
  • Loading branch information
aphraoh and vjik authored Mar 31, 2024
1 parent 7b94884 commit 70933b9
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions src/OffsetPagination.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,34 @@ public function paginator(OffsetPaginator $paginator): self
return $new;
}

public function labelPrevious(string|Stringable|null $label): self
{
$new = clone $this;
$new->labelPrevious = $label;
return $new;
}

public function labelNext(string|Stringable|null $label): self
{
$new = clone $this;
$new->labelNext = $label;
return $new;
}

public function labelFirst(string|Stringable|null $label): self
{
$new = clone $this;
$new->labelFirst = $label;
return $new;
}

public function labelLast(string|Stringable|null $label): self
{
$new = clone $this;
$new->labelLast = $label;
return $new;
}

/**
* Return a new instance with max nav link count.
*
Expand Down

0 comments on commit 70933b9

Please sign in to comment.