PHPackages                             sausin/laravel-set-autoincrement - 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. [Database &amp; ORM](/categories/database)
4. /
5. sausin/laravel-set-autoincrement

ActiveLibrary[Database &amp; ORM](/categories/database)

sausin/laravel-set-autoincrement
================================

Package to help with update of auto increment for database tables in laravel

v0.3.3(4y ago)2168[2 issues](https://github.com/sausin/laravel-set-autoincrement/issues)MITPHPPHP &gt;=7.2CI failing

Since Apr 10Pushed 4y ago2 watchersCompare

[ Source](https://github.com/sausin/laravel-set-autoincrement)[ Packagist](https://packagist.org/packages/sausin/laravel-set-autoincrement)[ RSS](/packages/sausin-laravel-set-autoincrement/feed)WikiDiscussions master Synced yesterday

READMEChangelog (10)Dependencies (8)Versions (16)Used By (0)

Laravel package to set custom Auto Increment in database
========================================================

[](#laravel-package-to-set-custom-auto-increment-in-database)

[![Latest Version on Packagist](https://camo.githubusercontent.com/89e96f5433f23d254b7e3d714b8ceeb4199b3901187508b14757753f7790523f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f73617573696e2f6c61726176656c2d7365742d6175746f696e6372656d656e742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/sausin/laravel-set-autoincrement)[![Total Downloads](https://camo.githubusercontent.com/5ebdf8e7de5a677f5e3ffe7278be12e593aff485c07de7c7c1e45e258b2d2c96/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f73617573696e2f6c61726176656c2d7365742d6175746f696e6372656d656e742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/sausin/laravel-set-autoincrement)[![Quality Score](https://camo.githubusercontent.com/d7a72852d1279e4088802b0971143b618b1971948cd502ceb80763357c961159/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f73617573696e2f6c61726176656c2d7365742d6175746f696e6372656d656e742e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/sausin/laravel-set-autoincrement)[![License: MIT](https://camo.githubusercontent.com/1b01ef0024ba0866c115986b895301f657c1b21fc29f05c4844b7f2e8d89204d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d79656c6c6f772e7376673f7374796c653d666c61742d737175617265)](https://opensource.org/licenses/MIT)

Wanted to easily set the starting ID for your models? This package makes it easy as a breeze! It's also possible to change auto increment on existing databases (i.e. new entries will start from the specified number).

Installation
============

[](#installation)

Run the below command in your Laravel project root.

```
composer require sausin/laravel-set-autoincrement
```

This will install the latest version of the package for you. The service provider will automatically register and make available the features of the package (which work automatically).

Configuration
=============

[](#configuration)

The default configuration will set the package such that except a few tables, the `AUTO_INCREMENT` counter will be set at `100001` (one hundred thousand and one).

To change the starting value and the tables affected by it, the configuration can be published using

```
php artisan vendor:publish
```

and then the option which corresponds to `Sausin\DBSetAutoIncrement\AutoIncrementServiceProvider` needs to be selected. This will add a config named `auto-increment.php` in your project's config folder.

Change the values as desired.

Usage
=====

[](#usage)

Default Behavior
----------------

[](#default-behavior)

It will run every time migrations are finished running, whether for the first time or incremental. All tables where the `AUTO_INCREMENT` value is higher than the value in the config will be left alone. Changes will be made in all the rest.

If, however, automatic updation behaviour is not desired, the `action` key in the config file can be changed to `manual` and the package will not take automatic action.

Command line
------------

[](#command-line)

Using the below command

```
php artisan db:set-auto-increment --tables=users --value=20001
```

the auto increment value can be changed manually. Multiple tables are accepted as input.

Supported SQL Drivers
=====================

[](#supported-sql-drivers)

Currently `mysql` and `sqlite` are supported. Plan to have support for more drivers in future.

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity49

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 ~33 days

Recently: every ~114 days

Total

15

Last Release

1767d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1efa495645876ee7b1157fb11de36597784034a721f787738b655ac574bf88ef?d=identicon)[sausin](/maintainers/sausin)

---

Top Contributors

[![sausin](https://avatars.githubusercontent.com/u/11542923?v=4)](https://github.com/sausin "sausin (30 commits)")

---

Tags

autoautoincrementdatabasedatabase-managementdatabase-migrationsincrementlaravelmysqlphpsqlitelaravelmysqlsqliteautoincrementauto-increment

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/sausin-laravel-set-autoincrement/health.svg)

```
[![Health](https://phpackages.com/badges/sausin-laravel-set-autoincrement/health.svg)](https://phpackages.com/packages/sausin-laravel-set-autoincrement)
```

###  Alternatives

[laravel/pulse

Laravel Pulse is a real-time application performance monitoring tool and dashboard for your Laravel application.

1.7k12.1M99](/packages/laravel-pulse)[watson/validating

Eloquent model validating trait.

9723.3M47](/packages/watson-validating)[dyrynda/laravel-model-uuid

This package allows you to easily work with UUIDs in your Laravel models.

4802.8M8](/packages/dyrynda-laravel-model-uuid)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9682.1M97](/packages/roots-acorn)[clickbar/laravel-magellan

This package provides functionality for working with the postgis extension in Laravel.

423715.4k1](/packages/clickbar-laravel-magellan)[reedware/laravel-relation-joins

Adds the ability to join on a relationship by name.

2121.2M13](/packages/reedware-laravel-relation-joins)

PHPackages © 2026

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