PHPackages                             dlnsk/faker-sequence - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. dlnsk/faker-sequence

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

dlnsk/faker-sequence
====================

Faker provider to generate incrementing, decrementing and manual sequences.

v0.2.0(3y ago)01381WTFPLPHPPHP ^7.1 || ^8.0

Since Dec 7Pushed 2y ago1 watchersCompare

[ Source](https://github.com/dlnsk/faker-sequence)[ Packagist](https://packagist.org/packages/dlnsk/faker-sequence)[ RSS](/packages/dlnsk-faker-sequence/feed)WikiDiscussions master Synced today

READMEChangelog (3)Dependencies (2)Versions (4)Used By (0)

Sequence Provider for Faker
---------------------------

[](#sequence-provider-for-faker)

This package will allow [Faker](https://github.com/FakerPHP/Faker) to generate incrementing, decrementing and manual sequences.

[![tests](https://github.com/dlnsk/faker-sequence/actions/workflows/tests.yml/badge.svg)](https://github.com/dlnsk/faker-sequence/actions/workflows/tests.yml)[![Latest Stable Version](https://camo.githubusercontent.com/c8477e4071166bb898e9f11896b0a0307c78b42bd23d668d00ce72da500c1ed2/687474703a2f2f706f7365722e707567782e6f72672f646c6e736b2f66616b65722d73657175656e63652f76)](https://packagist.org/packages/dlnsk/faker-sequence)[![License](https://camo.githubusercontent.com/93a7215d9d83f3c7f1157e39be7e3d3d4923206c0f9cc520d27f048b2b967011/687474703a2f2f706f7365722e707567782e6f72672f646c6e736b2f66616b65722d73657175656e63652f6c6963656e7365)](https://packagist.org/packages/dlnsk/faker-sequence)

Install
-------

[](#install)

To install, use composer:

```
composer require dlnsk/faker-sequence
```

Use
---

[](#use)

#### Laravel

[](#laravel)

This package supports Laravel's auto discovering, so you don't have to do anything else.

If you want to use the package in tests initialize sequences in `setUp`:

```
public function setUp(): void {
    ...
    $faker = app(\Faker\Generator::class);
    $faker->initSequence('seq_name', ['one', 'two']);
}
```

#### Other frameworks

[](#other-frameworks)

```
# When installed via composer
require_once 'vendor/autoload.php';

$faker = \Faker\Factory::create();
$faker->addProvider(new \Dlnsk\Faker\SequenceProvider($faker));
```

Generate
--------

[](#generate)

### Numeric sequences

[](#numeric-sequences)

#### Quick use

[](#quick-use)

```
echo $faker->nextInSequence('seq_name');    // 0
echo $faker->nextInSequence('seq_name');    // 1

$faker->resetSequence('seq_name');
echo $faker->nextInSequence('seq_name');    // 0
```

#### Initialization

[](#initialization)

```
$faker->initSequence(
    $name,          // Sequence name. You can use number of sequences simultaneously
    $start = 0,     // Starting value
    $step = 1,      // Sequence step, may be positive or negative
    $bound = null,  // Value that can be reached
    $loop = false   // Loop sequence or throw the exception NoMoreException on the bound
);
```

#### Improved use

[](#improved-use)

```
$faker->initSequence('seq_name', 10, -2);
echo $faker->nextInSequence('seq_name');    // 10
echo $faker->nextInSequence('seq_name');    // 8

$faker->initSequence('seq_name', 0, 2, 5);
echo $faker->nextInSequence('seq_name');    // 0
echo $faker->nextInSequence('seq_name');    // 2
echo $faker->nextInSequence('seq_name');    // 4
echo $faker->nextInSequence('seq_name');    // throw NoMoreException

$faker->initSequence('seq_name', 0, 2, 5, true);
echo $faker->nextInSequence('seq_name');    // 0
echo $faker->nextInSequence('seq_name');    // 2
echo $faker->nextInSequence('seq_name');    // 4
echo $faker->nextInSequence('seq_name');    // 0
```

### Iterable sequences

[](#iterable-sequences)

#### Initialization

[](#initialization-1)

```
$faker->initSequence(
    $name,          // Sequence name. You can use number of sequences simultaneously
    $collection,    // Array or iterable object
    $loop = false   // Loop sequence or throw the exception NoMoreException on the end
);
```

#### Using

[](#using)

```
$faker->initSequence('seq_name', ['one', 'two']);
echo $faker->nextInSequence('seq_name');    // one
echo $faker->nextInSequence('seq_name');    // two
echo $faker->nextInSequence('seq_name');    // throw NoMoreException

$faker->initSequence('seq_name', ['one', 'two'], true)
echo $faker->nextInSequence('seq_name');    // one
echo $faker->nextInSequence('seq_name');    // two
echo $faker->nextInSequence('seq_name');    // one

$singers = Employee::where('salary', '>', 10000)->get();
$faker->initSequence('seq_name', $singers);
echo $faker->nextInSequence('seq_name');    // { 'firstname' => 'Bob', 'lastname' => 'Dylan'}
echo $faker->nextInSequence('seq_name');    // { 'firstname' => 'Laura', 'lastname' => 'Marling'}
```

License
-------

[](#license)

This package is under the WTFPL license. Do whatever you want with it.

[LICENSE](https://github.com/dlnsk/faker-sequence/blob/master/LICENSE)

Reporting an issue or a feature request
---------------------------------------

[](#reporting-an-issue-or-a-feature-request)

Fork it, send a PR. Issues and feature requests are tracked in the [GitHub issue tracker](https://github.com/dlnsk/faker-sequence/issues).

###  Health Score

23

—

LowBetter than 26% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~1 days

Total

3

Last Release

1302d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/332778?v=4)[Dmitry Pupinin](/maintainers/dlnsk)[@dlnsk](https://github.com/dlnsk)

---

Top Contributors

[![dlnsk](https://avatars.githubusercontent.com/u/332778?v=4)](https://github.com/dlnsk "dlnsk (14 commits)")

---

Tags

fakerprovidersequenceiterateincrementDecrement

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/dlnsk-faker-sequence/health.svg)

```
[![Health](https://phpackages.com/badges/dlnsk-faker-sequence/health.svg)](https://phpackages.com/packages/dlnsk-faker-sequence)
```

###  Alternatives

[verbb/formie

The most user-friendly forms plugin for Craft.

102393.6k69](/packages/verbb-formie)[solspace/craft-freeform

The most flexible and user-friendly form building plugin!

54681.3k18](/packages/solspace-craft-freeform)[bluemmb/faker-picsum-photos-provider

picsum.photos provider for Faker

31244.2k2](/packages/bluemmb-faker-picsum-photos-provider)[aalaap/faker-youtube

Faker provider for generating fake YouTube video URLs

2292.3k](/packages/aalaap-faker-youtube)[xvladqt/faker-lorem-flickr

loremflickr.com provider for Faker

1585.6k1](/packages/xvladqt-faker-lorem-flickr)[directorytree/dummy

439.9k](/packages/directorytree-dummy)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
