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.1(2mo ago)21177.3k—7.4%2[1 issues](https://github.com/karoldabro/seeder-once/issues)MITPHPPHP &gt;=8.2.0CI failing

Since Feb 13Pushed 1mo 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 yesterday

READMEChangelog (5)Dependencies (8)Versions (14)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.

Sponsored by [Givore](https://givore.com) and [Mistflare](https://mistflare.studio)

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.3, 8.413.0`composer require "kdabrow/seeder-once: ^6.1"`8.2, 8.3, 8.410.0, 11.0, 12.0`composer require "kdabrow/seeder-once: ^6.1"`8.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

59

—

FairBetter than 98% of packages

Maintenance87

Actively maintained with recent releases

Popularity42

Moderate usage in the ecosystem

Community9

Small or concentrated contributor base

Maturity77

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

Recently: every ~337 days

Total

13

Last Release

83d 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://avatars.githubusercontent.com/u/49186?v=4)[kdabrow](/maintainers/kdabrow)[@kdabrow](https://github.com/kdabrow)

---

Top Contributors

[![karoldabro](https://avatars.githubusercontent.com/u/20278897?v=4)](https://github.com/karoldabro "karoldabro (77 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

[spatie/laravel-medialibrary

Associate files with Eloquent models

6.1k43.2M632](/packages/spatie-laravel-medialibrary)[larastan/larastan

Larastan - Discover bugs in your code without running it. A phpstan/phpstan extension for Laravel

6.5k55.4M8.4k](/packages/larastan-larastan)[laravel/ai

The official AI SDK for Laravel.

1.0k3.2M194](/packages/laravel-ai)[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[glushkovds/phpclickhouse-laravel

Adapter of the most popular library https://github.com/smi2/phpClickHouse to Laravel

2051.5M2](/packages/glushkovds-phpclickhouse-laravel)[itpathsolutions/dbstan

Database Standardization and Analysis Tool for Laravel

492.8k](/packages/itpathsolutions-dbstan)

PHPackages © 2026

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