PHPackages                             vahidalvandi/laravel-seedonce - 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. vahidalvandi/laravel-seedonce

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

vahidalvandi/laravel-seedonce
=============================

Laravel package to run seeders only once

0.1(1y ago)1158MITPHPPHP ^7.2|^8.0

Since Mar 22Pushed 1y agoCompare

[ Source](https://github.com/vahidalvandi/laravel-seedonce)[ Packagist](https://packagist.org/packages/vahidalvandi/laravel-seedonce)[ RSS](/packages/vahidalvandi-laravel-seedonce/feed)WikiDiscussions 1.x Synced 1mo ago

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

Laravel SeedOnce
================

[](#laravel-seedonce)

This package works similar to `php artisan migrate`. When using this package, each seeder is seeded only once even if you run `php artisan db:seed` multiple times (on each deployment).

Why was this package developed?
-------------------------------

[](#why-was-this-package-developed)

The purpose of this package is to make it easier for the developers to run seeders when working in teams and to run seeders during automated deployments. One doesn't need to remember which seeders have already been executed and which are pending. All this is handled by this package.

Assumption
----------

[](#assumption)

This package assumes that you use one seeder (ex.`DatabaseSeeder`) class as the main/parent for running all other seeders. This main seeder class should never seed any data directly on its own. It should only be used to run other seeder classes.

Installation
------------

[](#installation)

Use composer to install the package.

```
composer require vahidalvandi/laravel-seedonce

```

Optionally, publish the package configuration file. Default config should work well in most of the cases.

```
php artisan vendor:publish --tag=laravel-seedonce-config

```

After the package is installed by composer, run the migrations to create a table which will hold the seeder information.

```
php artisan migrate

```

Note: This will create a table named `seeders` in your database. If you want to change this table's name, then you have to publish the package's config (above step) and modify the value of `table` in `config/seedonce.php`.

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

[](#configuration)

Once you have published the configuration file, you can edit it to suit your needs. Configuration options are as follows:

- `table`: This is the name of the table that will hold the details of the seeders that have been executed. The default value is *seeders* which should work in most of the cases.
- `database_seeder`: This is the name of the class that seeds all other seeders. In most of the cases this will be *DatabaseSeeder* which is the default value. Make sure to change this if you use a different class as the entry point to seed all other seeders.
- `folder_seeder`: This is the folder of contains the seeders files laravel &lt; 8 use *seeds* and laravel &gt;= 8 use *seeders*

Usage
-----

[](#usage)

Use the `vahidalvandi\SeedOnce\Traits\SeedOnce` trait in all your seeder classes including the main seeder (ex. `DatabaseSeeder`) class.

```

```

That's it. Now no matter how many times you run `php artisan db:seed`, the `UsersTableSeeder` will only be executed once.

### Projects with existing seeders

[](#projects-with-existing-seeders)

The usage instructions above assumes that you have installed this package before running any seeders. If you have already executed some or all seeders before installing this package, then you will need to mark those seeders as executed.

Run the following command to mark all existing seeder classes as seeded.

```
php artisan seedonce:mark-seeded

```

If you only want to mark specific seeder class as seeded, then run this command

```
php artisan seedonce:mark-seeded --class=UsersTableSeeder

```

Seeders Status
--------------

[](#seeders-status)

Often you would want to know that status of your seeder classes i.e. which seeders have been executed and which are pending. Run the following command to get the status

```
php artisan seedonce:status

```

This will output a table with status of each seeder class

Seeded?SeederYesUsersTableSeederNoRolesTableSeederTesting
-------

[](#testing)

The package unit tests can be executed with the following command (from inside package's root directory)

```
composer test

```

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance46

Moderate activity, may be stable

Popularity12

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity32

Early-stage or recently created project

 Bus Factor1

Top contributor holds 76.3% 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 ~0 days

Total

2

Last Release

416d ago

Major Versions

0.1 → 1.x-dev2025-03-22

### Community

Maintainers

![](https://www.gravatar.com/avatar/460dbe742346b9f2dd0abf8c1b9198692629639475e90ec173ecf7480bd584e5?d=identicon)[vahidalvandi](/maintainers/vahidalvandi)

---

Top Contributors

[![abbasali](https://avatars.githubusercontent.com/u/145739?v=4)](https://github.com/abbasali "abbasali (29 commits)")[![medeiroz](https://avatars.githubusercontent.com/u/11270546?v=4)](https://github.com/medeiroz "medeiroz (6 commits)")[![vahidalvandi](https://avatars.githubusercontent.com/u/7871623?v=4)](https://github.com/vahidalvandi "vahidalvandi (2 commits)")[![chiranjeeb-ranium](https://avatars.githubusercontent.com/u/48713316?v=4)](https://github.com/chiranjeeb-ranium "chiranjeeb-ranium (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/vahidalvandi-laravel-seedonce/health.svg)

```
[![Health](https://phpackages.com/badges/vahidalvandi-laravel-seedonce/health.svg)](https://phpackages.com/packages/vahidalvandi-laravel-seedonce)
```

###  Alternatives

[owen-it/laravel-auditing

Audit changes of your Eloquent models in Laravel

3.4k33.0M95](/packages/owen-it-laravel-auditing)[staudenmeir/eloquent-json-relations

Laravel Eloquent relationships with JSON keys

1.1k5.8M24](/packages/staudenmeir-eloquent-json-relations)[bavix/laravel-wallet

It's easy to work with a virtual wallet.

1.3k1.1M11](/packages/bavix-laravel-wallet)[dragon-code/migrate-db

Easy data transfer from one database to another

15717.4k](/packages/dragon-code-migrate-db)[gearbox-solutions/eloquent-filemaker

A package for getting FileMaker records as Eloquent models in Laravel

6454.8k2](/packages/gearbox-solutions-eloquent-filemaker)[cybercog/laravel-ownership

Laravel Ownership simplify management of Eloquent model's owner.

9126.6k3](/packages/cybercog-laravel-ownership)

PHPackages © 2026

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