muhammadhammadwaseem/db-mig-generator
最新稳定版本:v2.0.0
Composer 安装命令:
composer require muhammadhammadwaseem/db-mig-generator
包简介
Generate Laravel migrations from existing DB.
README 文档
README
Automatically generate Laravel migration files from an existing database schema — with built-in support for ENUM columns and zero manual setup.
🚀 Installation
composer require hammad123/laravel-db-migration-generator ✅ Compatible with Laravel 8, 9, and 10 ✅ Supports MySQL, MariaDB ✅ Automatically handles enum columns (converted to string()) ⚙️ Usage Run the Artisan command to generate migrations from your current database: php artisan hammad:migrate:generate 🔧 Options Option Description --connection= Use a specific DB connection from config/database.php --path= Output path for generated migrations 🧠 ENUM Support You don't need to manually map ENUM types — the package internally handles it. Example: status ENUM('active', 'inactive') DEFAULT 'active' Will be converted to: $table->string('status')->default('active'); 📁 Configuration (Optional) You can publish the config file to skip tables or customize paths: php artisan vendor:publish --tag=config This publishes: config/migration-generator.php Inside, you can: Skip specific tables Change default stub path Change default migration directory ✍️ Custom Stub You can publish and customize the stub used for migrations: php artisan vendor:publish --tag=stubs This gives you: resources/stubs/migration.stub You can edit the layout of the generated migration (e.g., indentation, formatting). ✅ Testing (For Contributors) This package uses Orchestra Testbench to test migrations in a real Laravel environment. Run tests: composer install --dev vendor/bin/phpunit 🤝 Contributing Pull requests and feature suggestions are welcome! If you find a bug or want a new feature, open an issue on GitHub. 📄 License MIT © Hammad 📦 Coming Soon (Optional Features) Column comments Foreign key support Relationships (HasMany, BelongsTo) Laravel 11 support.
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-07-09