PHPackages                             davidvandertuijn/laravel-after-seeders - 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. davidvandertuijn/laravel-after-seeders

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

davidvandertuijn/laravel-after-seeders
======================================

Laravel After Seeders

3.0.1(1y ago)01.8kMITPHPPHP &gt;=8.0.0

Since Jun 27Pushed 1y ago1 watchersCompare

[ Source](https://github.com/davidvandertuijn/laravel-after-seeders)[ Packagist](https://packagist.org/packages/davidvandertuijn/laravel-after-seeders)[ RSS](/packages/davidvandertuijn-laravel-after-seeders/feed)WikiDiscussions master Synced today

READMEChangelog (4)DependenciesVersions (6)Used By (0)

Laravel After Seeders
=====================

[](#laravel-after-seeders)

[![Total Downloads](https://camo.githubusercontent.com/a309c3b4dfe27d12fb3a529b27066602b6f9615ecec9fd05988ecfa3002420b9/68747470733a2f2f706f7365722e707567782e6f72672f646176696476616e6465727475696a6e2f6c61726176656c2d61667465722d736565646572732f642f746f74616c2e737667)](https://packagist.org/packages/davidvandertuijn/laravel-after-seeders)[![Latest Stable Version](https://camo.githubusercontent.com/fefcdf7568ad25cf82447fb9c7ecc5070093b50b319bdcbd4f6b05bb379ecb34/68747470733a2f2f706f7365722e707567782e6f72672f646176696476616e6465727475696a6e2f6c61726176656c2d61667465722d736565646572732f762f737461626c652e737667)](https://packagist.org/packages/davidvandertuijn/laravel-after-seeders)[![License](https://camo.githubusercontent.com/72b94bdbf7acda53a7927eff5beca5f074199400397a8247998b2722cef083df/68747470733a2f2f706f7365722e707567782e6f72672f646176696476616e6465727475696a6e2f6c61726176656c2d61667465722d736565646572732f6c6963656e73652e737667)](https://packagist.org/packages/davidvandertuijn/laravel-after-seeders)

[![Laravel After Seeders](https://camo.githubusercontent.com/b8227ae225ea32597da7e7987799ca3a79dbf3c0e5033afd166cad0fba2544bf/68747470733a2f2f63646e2e646176696476616e6465727475696a6e2e6e6c2f6769746875622f6c61726176656c2d61667465722d736565646572732e706e67)](https://camo.githubusercontent.com/b8227ae225ea32597da7e7987799ca3a79dbf3c0e5033afd166cad0fba2544bf/68747470733a2f2f63646e2e646176696476616e6465727475696a6e2e6e6c2f6769746875622f6c61726176656c2d61667465722d736565646572732e706e67)

This library adds seeder functionality with ***versioning*** support for [Laravel](https://laravel.com/), making it ideal for a ***production environment***. Seeders are stored in the *database/after\_seeders* directory in JSON format. The execution progress of each seeder is tracked in the after\_seeders table, ensuring that each seeder is only seed once.

[!["Buy Me A Coffee"](https://camo.githubusercontent.com/9f44ce2dc3b3eecdd02598900866ffc518801df1932849703dae1e5ce5031070/68747470733a2f2f7777772e6275796d6561636f666665652e636f6d2f6173736574732f696d672f637573746f6d5f696d616765732f6f72616e67655f696d672e706e67)](https://www.buymeacoffee.com/davidvandertuijn)

Install
-------

[](#install)

Install the package via Composer:

```
composer require davidvandertuijn/laravel-after-seeders
```

Run the migrations:

```
php artisan migrate
```

Publish the configuration file:

```
php artisan vendor:publish --provider="Davidvandertuijn\LaravelAfterSeeders\ServiceProvider"
```

Usage
-----

[](#usage)

### Create a New Seeder Automatically

[](#create-a-new-seeder-automatically)

Use the command below to create a complete seeder based on existing records in a database table.

```
php artisan after-seeders:make my_table
```

The command will prompt you to include or exclude specific columns from the table. If you skip a column, it won’t be included in the seeder file. You can also define a range of record IDs to include.

Example prompt:

```
Columns for table "my_table".
Would you like to add the column "id" ? (yes/no) [no]: y
Would you like to add the column "name" ? (yes/no) [no]: y
Would you like to add the column "dateofbirth" ? (yes/no) [no]:
Select range for table "my_table".
Enter the starting ID [0]: 12
Enter the ending ID [13]: 13

```

After completion, you’ll get the following message:

```
database/after_seeders/YYYY_MM_DD_XXXXXX_my_table.json ... DONE

```

And the seeder will look like this:

```
{
    "RECORDS": [
        {
            "id": 12,
            "name": "John Doe"
        },
        {
            "id": 13,
            "name": "Jane Doe"
        }
    ]
}
```

### Create a New Seeder Manually

[](#create-a-new-seeder-manually)

Use the following command to create an empty “after seeder” file. This option is ideal if you’re already familiar with the JSON structure and prefer to manually input the data.

```
php artisan after-seeders:placeholder my_table
```

You’ll see the following output upon success:

```
database/after_seeders/YYYY_MM_DD_XXXXXX_my_table.json ... DONE

```

A basic structure for the JSON file will look like this:

```
{
    "RECORDS": [
        {
            "name": "Example"
        }
    ]
}
```

If you use [Navicat for MySQL](https://www.navicat.com/en/products/navicat-for-mysql), it follows the same format when exporting data to a .json file.

### Running Seeders

[](#running-seeders)

To execute pending “after seeders,” run the following command:

```
php artisan after-seeders:seed
```

The command checks whether the specified table and columns exist. If not, the seeder will be skipped.

After completion, you’ll get the following message:

```
Run batch "X".
database/after_seeders/YYYY_MM_DD_XXXXXX_my_table.json ... 1.23ms DONE

```

---

***Handling created\_at***

If the table has a ***created\_at*** column and it’s missing from the seeder, the current timestamp will be automatically inserted.

***Update Or Insert***

If the seeder contains an ***id*** column, the [updateOrInsert](https://laravel.com/docs/10.x/queries#update-or-insert) method will be used. Otherwise, the [insert](https://laravel.com/docs/10.x/queries#insert-statements) method will be applied.

### Tags

[](#tags)

You can use tags to organize and manage your seeders more effectively. By adding a tag, you can group seeders and seed specific groups when needed.

#### Create a Seeder with a Tag

[](#create-a-seeder-with-a-tag)

To generate a seeder based on existing records and assign a tag, use the --tag option:

```
php artisan after-seeders:make my_table --tag=my_tag
```

Similarly, you can create an empty seeder and assign a tag:

```
php artisan after-seeders:placeholder my_table --tag=my_tag
```

Running Seeders by Tag

When running seeders, you can specify a tag to seed only the seeders that belong to that group:

```
php artisan after-seeders:seed --tag=my_tag
```

This allows you to selectively execute seeders based on tags, making it easier to control which seeders are applied in different environments or scenarios.

### Deployment

[](#deployment)

When deploying your application, you can execute seeders with specific tags using the deployment command. Before doing this, you’ll need to define the tags in your project’s configuration file located at *config/after\_seeders.php.*

```
'tags' => [
    ...
],
```

To run the seeders during deployment, simply use the following command:

```
php artisan after-seeders:deploy
```

###  Health Score

33

—

LowBetter than 72% of packages

Maintenance34

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity57

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

Total

5

Last Release

636d ago

Major Versions

1.0.1 → 2.0.02024-10-04

2.0.0 → 3.0.02024-10-05

PHP version history (2 changes)1.0PHP &gt;=7.0.0

1.0.1PHP &gt;=8.0.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/6d8904bedce7fb2ec131c0d18c13aeaa82b00af2fd03ebe099886ac462b1d29e?d=identicon)[davidvandertuijn](/maintainers/davidvandertuijn)

---

Top Contributors

[![davidvandertuijn](https://avatars.githubusercontent.com/u/11010507?v=4)](https://github.com/davidvandertuijn "davidvandertuijn (9 commits)")

### Embed Badge

![Health badge](/badges/davidvandertuijn-laravel-after-seeders/health.svg)

```
[![Health](https://phpackages.com/badges/davidvandertuijn-laravel-after-seeders/health.svg)](https://phpackages.com/packages/davidvandertuijn-laravel-after-seeders)
```

###  Alternatives

[atchondjo/geoip2country

A lightweight but powerful IP address lookup database solution to determine visitors country

344.7k](/packages/atchondjo-geoip2country)

PHPackages © 2026

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