Download the PHP package codebider/seeder-versioning-tool without Composer
On this page you can find all versions of the php package codebider/seeder-versioning-tool. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package seeder-versioning-tool
Laravel Seeder Versioning Tool
A Laravel package to manage and version database seeders using Artisan commands. This tool ensures that seeders are executed in a controlled and chronological order, with support for modules and batch tracking.
π¦ Installation
You can install the package via Composer:
If youβre using Laravel < 5.5, add the service provider manually in config/app.php
:
βοΈ Configuration (Optional)
You can publish the migration and stub files using:
Make sure to run the migration to create the seeders
table:
This will publish:
database/migrations/2025_04_29_171328_create_seeders_table.php
stubs/versioned_seeder.stub
π§ͺ Usage
Running Versioned Seeders
Run all versioned seeders in chronological order:
Options:
--connection=
: Specify the database connection.--database=
: Specify the database name.--module=
: Run seeders for a specific module.
Creating a Versioned Seeder
Generate a new versioned seeder file:
Options:
--module=
: Specify the module name for the seeder.
This will create a timestamped seeder file in the database/seeders/Versioned
directory (or inside the specified module).
π How It Works
-
Versioned Seeder Execution:
- Seeders are executed in chronological order based on their file creation time.
- Each seeder is tracked in the
seeders
table to prevent duplicate execution.
-
Batch Tracking:
- Seeders are grouped into batches for better tracking and rollback capabilities.
-
Module Support:
- Seeders can be organized into modules for better separation of concerns.
- Custom Stub:
- The default stub file for versioned seeders can be customized by modifying the published
stubs/versioned_seeder.stub
.
- The default stub file for versioned seeders can be customized by modifying the published
βοΈ Custom Stub
The stub file supports the following variables:
{{ namespace }}
{{ class }}
Example stub:
π License
This package is open-sourced software licensed under the MIT license.
π€ Author
Developed with β€οΈ by Awais Javaid
π¦ Package: codebider/seeder-versioning-tool
π€ Contributing
Contributions are welcome! Please feel free to submit a Pull Request or open an issue.