PHPackages                             sonole/laravel-db-seed-rollback - 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. [Framework](/categories/framework)
4. /
5. sonole/laravel-db-seed-rollback

ActiveLibrary[Framework](/categories/framework)

sonole/laravel-db-seed-rollback
===============================

v1.0.1(2y ago)032MITPHP

Since Nov 2Pushed 2y ago1 watchersCompare

[ Source](https://github.com/sonole/laravel-db-seed-rollback)[ Packagist](https://packagist.org/packages/sonole/laravel-db-seed-rollback)[ Docs](https://github.com/sonole/laravel-db-seed-rollback)[ RSS](/packages/sonole-laravel-db-seed-rollback/feed)WikiDiscussions master Synced 1mo ago

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

Laravel db:seed with Rollback option
====================================

[](#laravel-dbseed-with-rollback-option)

**Introduction**
In the context of package development, particularly those involving database seeders, I propose the introduction of the `--rollback` option for the `db:seed` command. This feature complements the existing `migrate:rollback` command and offers a solution for efficient database seeding management.

**The Problem**
Currently, many projects rely on packages that utilize seeders to alter the database. However, when complications arise, such as errors, changes in requirements, or the need to remove packages, there is a lack of streamlined mechanisms to revert these seeding changes. While the `migrate:rollback` command helps with migrations, the absence of a corresponding option for seeders presents challenges in complex projects where multiple custom packages are involved.

**The Solution**
By introducing the `--rollback` option for the `db:seed` command, package developers and maintainers can now address these issues.

**Use Case**
Just run `db:seed` with the `--rollback` option and `down()` function will be invoked!

```
php artisan db:seed --class="Vendor\\Package\\Database\\Seeders\\UsersSeeder" --rollback
#or
php artisan db:seed --rollback
```

```
namespace Vendor\Package\Database\Seeders

/** If your seeder does not extend the package's Seeder:
 * Sonole\LaravelDbSeedRollback\Illuminate\Database\Seeder
 * then a new temporary file will be created at database/seeders, and it will be deleted after down() execution.
*/
use Illuminate\Database\Seeder;

class UsersSeeder extends Seeder
{
    /**
     * Seed the application's database.
     */
    public function run(): void
    {
         //\App\Models\User::factory(10)->create();

        // \App\Models\User::factory()->create([
        //     'name' => 'Test User',
        //     'email' => 'test@example.com',
        // ]);
    }

    /**
     * Reverse the effects of the database seeding operation.
     */
    public function down(): void
    {
        \App\Models\User::where('email', 'foo@bar.com')->delete();
    }
}
```

###  Health Score

21

—

LowBetter than 18% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity44

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

Total

2

Last Release

921d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7dbc8a15d5d8359c27a67727254856a648f0525c507c197a6fbec21cbd402b92?d=identicon)[sonole](/maintainers/sonole)

---

Top Contributors

[![sonole](https://avatars.githubusercontent.com/u/74705540?v=4)](https://github.com/sonole "sonole (13 commits)")

---

Tags

dblaravelmigraterollbackseedframeworklaraveldbseedrollback

### Embed Badge

![Health badge](/badges/sonole-laravel-db-seed-rollback/health.svg)

```
[![Health](https://phpackages.com/badges/sonole-laravel-db-seed-rollback/health.svg)](https://phpackages.com/packages/sonole-laravel-db-seed-rollback)
```

###  Alternatives

[codewithdennis/larament

Larament is a time-saving starter kit to quickly launch Laravel 13.x projects. It includes FilamentPHP 5.x pre-installed and configured, along with additional tools and features to streamline your development workflow.

3691.5k](/packages/codewithdennis-larament)[kompo/kompo

Laravel &amp; Vue.js FullStack Components for Rapid Application Development

11812.4k21](/packages/kompo-kompo)

PHPackages © 2026

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