codebider/seeder-versioning-tool
Composer 安装命令:
composer require codebider/seeder-versioning-tool
包简介
A Laravel package to versioning the seeders using an Artisan command.
README 文档
README
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:
composer require codebider/seeder-versioning-tool
If you’re using Laravel < 5.5, add the service provider manually in config/app.php:
'providers' => [ CodeBider\versionSeeder\versionSeederServiceProvider::class, ];
⚙️ Configuration (Optional)
You can publish the migration and stub files using:
php artisan vendor:publish --provider="CodeBider\versionSeeder\versionSeederServiceProvider"
Make sure to run the migration to create the seeders table:
php artisan vendor:publish --tag=migrations php artisan migrate
This will publish:
database/migrations/2025_04_29_171328_create_seeders_table.phpstubs/versioned_seeder.stub
🧪 Usage
Running Versioned Seeders
Run all versioned seeders in chronological order:
php artisan db:seed:versioned
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:
php artisan make:seeder:versioned SeederName
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
seederstable 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:
<?php namespace {{ namespace }}; use App\Console\VersionedSeeder; class {{ class }} extends VersionedSeeder { public function run() { // Add your seeding logic here } }
📄 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.
codebider/seeder-versioning-tool 适用场景与选型建议
codebider/seeder-versioning-tool 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 32 次下载、GitHub Stars 达 2, 最近一次更新时间为 2025 年 04 月 29 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「generator」 「migration」 「laravel」 「artisan」 「seeder」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 codebider/seeder-versioning-tool 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 codebider/seeder-versioning-tool 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 codebider/seeder-versioning-tool 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Memio's PrettyPrinter, used to generate PHP code from given Model
Lets you add foreign keys in a swift! Foreign key adder in laravel migration.
Manage PostgreSQL schemas in Laravel applications
Bitrix db migration core libs
The YADM migrations
Data migration mechanism for php using dbal do doctrine with pdo, schema and queryBuilder
统计信息
- 总下载量: 32
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 8
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-04-29