Download the PHP package thetheago/laravel-seeder-versioning without Composer
On this page you can find all versions of the php package thetheago/laravel-seeder-versioning. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download thetheago/laravel-seeder-versioning
More information about thetheago/laravel-seeder-versioning
Files in thetheago/laravel-seeder-versioning
Package laravel-seeder-versioning
Short Description A Laravel package that provides version control for database seeders, similar to Laravel's migration system. This package tracks which seeders have been run and only executes seeders that have been modified by monitoring class content changes.
License MIT
Informations about the package laravel-seeder-versioning
Laravel Seeder Versioning
A Laravel package that provides version control for database seeders, similar to Laravel's migration system. This package tracks which seeders have been run and only executes seeders that have been modified by monitoring class content changes.
Features
- Tracks seeder execution history
- Only runs modified seeders
- Validates seeder content changes using hash verification
- Simple integration with Laravel's existing seeder system
- Option to generate hash versioning without running seeders
Installation / Configuration
You can install the package via composer:
Publish the package configuration and migrations:
Run the migrations to create the seeder versioning table:
Usage
Running Seeders
To run your seeders with version control:
This command will:
- Check all your seeders
- Compare their content against previously run versions
- Only execute seeders that have been modified or haven't been run before
Hash Generation Only
If you want to generate hash versions for your seeders without executing them:
This is useful for:
- Initial setup in existing projects
- Verifying which seeders would be executed
- Updating the version control table without running seeders
How It Works
The package creates a seeder_versioning table that stores:
- Seeder class names
- Content hashes
- Execution timestamps
When you run seed:migrate, the package:
- Scans your seeder directory
- Generates a hash for each seeder's content
- Compares against stored hashes
- Executes only modified or new seeders
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
This package is open-sourced software licensed under the MIT license.