PHPackages                             garanaw/seedable-migrations - 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. garanaw/seedable-migrations

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

garanaw/seedable-migrations
===========================

Allows to self seed migrations in a more controlled way

1.2.0(1y ago)322MITPHPPHP &gt;=8.2|^8.3|^8.4CI passing

Since Dec 3Pushed 1y ago1 watchersCompare

[ Source](https://github.com/Garanaw/seedable-migrations)[ Packagist](https://packagist.org/packages/garanaw/seedable-migrations)[ RSS](/packages/garanaw-seedable-migrations/feed)WikiDiscussions main Synced 1mo ago

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

Laravel Seedable Migrations

[](#laravel-seedable-migrations)

[![Tests](https://github.com/Garanaw/seedable-migrations/actions/workflows/tests.yml/badge.svg)](https://github.com/Garanaw/seedable-migrations/actions)[![Linting](https://github.com/Garanaw/seedable-migrations/actions/workflows/pint.yml/badge.svg)](https://github.com/Garanaw/seedable-migrations/actions)

About
-----

[](#about)

Laravel provides a migration system with seeding. However, the seeding system is not very flexible. This package provides a more flexible way to seed your database with seed files linked to migrations.

You can run your seeding after each migration, or at the end of the batch. You can also specify seeder files that should run on the UP method or the DOWN method of your migrations.

Install
-------

[](#install)

To install the package, run the following command:

```
composer require garanaw/seedable-migrations
```

After installing the package, you need to publish the migration stubs:

```
php artisan vendor:publish --provider="Garanaw\SeedableMigrations\SeedableMigrationsServiceProvider"
```

If you don't want to publish the stubs, you will need to extend your migrations manually from the `Garanaw\SeedableMigrations\Migration` class.

The new migration file
----------------------

[](#the-new-migration-file)

The migration files will look a bit different now when you run the command `php artisan make:migration`. The new migration files will look like this:

```
