codebider/seeder-versioning-tool 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

codebider/seeder-versioning-tool

Composer 安装命令:

composer require codebider/seeder-versioning-tool

包简介

A Laravel package to versioning the seeders using an Artisan command.

README 文档

README

Seeder Versioning Tool

License: MIT Packagist Downloads Packagist Version

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.php
  • stubs/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

  1. 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.
  2. Batch Tracking:

    • Seeders are grouped into batches for better tracking and rollback capabilities.
  3. Module Support:

    • Seeders can be organized into modules for better separation of concerns.
  4. Custom Stub:

    • The default stub file for versioned seeders can be customized by modifying the published stubs/versioned_seeder.stub.

✏️ 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 我们能提供哪些服务?
定制开发 / 二次开发

基于 codebider/seeder-versioning-tool 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 32
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 3
  • 点击次数: 8
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-04-29