PHPackages                             kdabrow/seeder-once - 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. kdabrow/seeder-once

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

kdabrow/seeder-once
===================

Run your laravel seeders only once

6.0.0(1y ago)19160.9k—0%1[1 PRs](https://github.com/karoldabro/seeder-once/pulls)MITPHPPHP &gt;=8.2.0CI failing

Since Feb 13Pushed 1y ago1 watchersCompare

[ Source](https://github.com/karoldabro/seeder-once)[ Packagist](https://packagist.org/packages/kdabrow/seeder-once)[ RSS](/packages/kdabrow-seeder-once/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (4)Dependencies (4)Versions (13)Used By (0)

[![GitHub Workflow Status (branch)](https://github.com/karoldabro/seeder-once/actions/workflows/laravel.yml/badge.svg)](https://github.com/karoldabro/seeder-once/actions/workflows/laravel.yml/badge.svg)[![Packagist Version](https://camo.githubusercontent.com/415ac7d3f632fe6de67413e1a7a06cb7ca16054c27427c9b4946eeda035caa02/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6b646162726f772f7365656465722d6f6e6365)](https://camo.githubusercontent.com/415ac7d3f632fe6de67413e1a7a06cb7ca16054c27427c9b4946eeda035caa02/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6b646162726f772f7365656465722d6f6e6365)[![Packagist Downloads](https://camo.githubusercontent.com/d913cb8b1cfde71b77511404de3276211b3d0053af883b167c78f1741c558d80/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646d2f6b646162726f772f7365656465722d6f6e6365)](https://camo.githubusercontent.com/d913cb8b1cfde71b77511404de3276211b3d0053af883b167c78f1741c558d80/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646d2f6b646162726f772f7365656465722d6f6e6365)[![Scrutinizer code quality (GitHub/Bitbucket)](https://camo.githubusercontent.com/ff974438f98b0a731820b7b86490bd81e2fc9b30c626203b954de7a1f00a73f5/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f7175616c6974792f672f6b61726f6c646162726f2f7365656465722d6f6e63652f6d6173746572)](https://camo.githubusercontent.com/ff974438f98b0a731820b7b86490bd81e2fc9b30c626203b954de7a1f00a73f5/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f7175616c6974792f672f6b61726f6c646162726f2f7365656465722d6f6e63652f6d6173746572)

Laravel Seeder Once
===================

[](#laravel-seeder-once)

This library allows you to run your Laravel seeders only once.
 No matter how many times artisan command `db:seed` is called. Done seeders will never be executed again.

How it works
------------

[](#how-it-works)

Works similarly to migrations. First creates table in database, then logs all seeds that extend abstract class `Kdabrow\SeederOnce\SeederOnce`. In nutshell this will prevent to execute method run() if was executed in the past. Mechanism of logging data into database is heavily inspired by Laravel migration mechanism from package illuminate/database.

How to use it
-------------

[](#how-to-use-it)

### 1. Install it

[](#1-install-it)

By composer:

phplaravel / lumenseeder-once8.2, 8.3, 8.412.0`composer require "kdabrow/seeder-once: ^6.0"`8.2, 8.310.0, 11.0`composer require "kdabrow/seeder-once: ^5.0"`8.1, 8.210.0`composer require "kdabrow/seeder-once: ^4.0"`8.0, 8.19.21`composer require "kdabrow/seeder-once: ^3.0"`7.3, 7.4, 8.08.0, 9.0`composer require "kdabrow/seeder-once: ^2.2"`7.2, 7.3, 7.4, 8.06.0, 7.0`composer require "kdabrow/seeder-once: ^1.2"`In Lumen do not forget to register provider in bootstrap/app.php

```
$app->register(Kdabrow\SeederOnce\Providers\SeederOnceProvider::class);
```

### 2. Create seeders table in database

[](#2-create-seeders-table-in-database)

Use this command:

```
php artisan db:install
```

This step is optional. Trait SeederOnce detects if table exists. If not, creates it automatically.

### 3. Extend seeders that you want to be run only once with SeederOnce

[](#3-extend-seeders-that-you-want-to-be-run-only-once-with-seederonce)

So result should look like this:

```
use Kdabrow\SeederOnce\SeederOnce;

class SomeSeeder extends SeederOnce
{
    /**
     * Seed the application's database.
     *
     * @return void
     */
    public function run()
    {
        //
    }
}
```

This prevents to seed class SomeSeeder if was already seeded before.
**Tip**: Always replace class Seeder with SeederOnce. Otherwise, `db:seed` command might print unexpected results.

Configuration
-------------

[](#configuration)

### Run seeder many times

[](#run-seeder-many-times)

It is possible to overwrite default functionality by change parameter $seedOnce to false:

```
use Kdabrow\SeederOnce\SeederOnce;

class DatabaseSeeder extends SeederOnce
{
    public bool $seedOnce = false;

    /**
     * Seed the application's database.
     *
     * @return void
     */
    public function run()
    {
        //
    }
}
```

Such seeder will run like normal laravel seeder (as many times as called).

### Configuration file

[](#configuration-file)

It is possible to publish configuration file:

```
php artisan vendor:publish --tag=seederonce.config
```

#### Table name

[](#table-name)

Default table name is: seeders

#### Console output

[](#console-output)

By default, seeder-once changes output of db:seed console command. Seeders that were run in the past will not be printed in the command output. It's possible to change that behaviour in configuration or by env variable:

```
SEEDER_ONCE_PRINT_OUTPUT=true
```

Output for already run seeders looks like this:

```
Database\Seeders\SomeSeeder was already seeded ..................... DONE
```

###  Health Score

47

—

FairBetter than 94% of packages

Maintenance43

Moderate activity, may be stable

Popularity41

Moderate usage in the ecosystem

Community8

Small or concentrated contributor base

Maturity76

Established project with proven stability

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

Recently: every ~265 days

Total

12

Last Release

447d ago

Major Versions

1.2.0 → 2.0.02020-10-29

2.2.0 → 3.0.02022-07-29

3.0.0 → 4.0.02023-04-10

4.0.0 → 5.0.02024-04-02

5.0.0 → 6.0.02025-02-25

PHP version history (5 changes)1.0.0PHP &gt;= 7.3

1.1.0PHP &gt;= 7.1

1.1.1PHP &gt;= 7.2

3.0.0PHP &gt;=8.0.2

5.0.0PHP &gt;=8.2.0

### Community

Maintainers

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

---

Top Contributors

[![karoldabro](https://avatars.githubusercontent.com/u/20278897?v=4)](https://github.com/karoldabro "karoldabro (75 commits)")

---

Tags

phplaraveldatabaseseeder

### Embed Badge

![Health badge](/badges/kdabrow-seeder-once/health.svg)

```
[![Health](https://phpackages.com/badges/kdabrow-seeder-once/health.svg)](https://phpackages.com/packages/kdabrow-seeder-once)
```

###  Alternatives

[spiritix/lada-cache

A Redis based, automated and scalable database caching layer for Laravel

591444.8k2](/packages/spiritix-lada-cache)[toponepercent/baum

Baum is an implementation of the Nested Set pattern for Eloquent models.

3154.7k](/packages/toponepercent-baum)[jlapp/smart-seeder

Smart Seeder adds the same methology to seeding that is currently used with migrations in order to let you seed in batches, seed to production databases or other environments, and to rerun seeds without wiping out your data.

1903.1k](/packages/jlapp-smart-seeder)[webparking/laravel-type-safe-collection

This package provides type-safe extension of the laravel collection, forcing a single type of object.

378.2k](/packages/webparking-laravel-type-safe-collection)[calebdw/laravel-sql-entities

Manage SQL entities in Laravel with ease.

301.3k](/packages/calebdw-laravel-sql-entities)

PHPackages © 2026

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