Download the PHP package dibakar/db-sync without Composer
On this page you can find all versions of the php package dibakar/db-sync. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download dibakar/db-sync
More information about dibakar/db-sync
Files in dibakar/db-sync
Package db-sync
Short Description A Laravel package for database synchronization with support for migrations and SQL imports
License MIT
Informations about the package db-sync
Laravel DB Sync
A powerful Laravel package for database synchronization, migration, and SQL file import operations. This package provides a unified interface to manage your database schema and data across different environments with ease and confidence.
✨ Features
- Flexible Database Operations: Supports various database operations including migrations, fresh migrations, and refresh operations
- SQL File Import: Import SQL files or directories of SQL files directly
- Multiple Database Connections: Work with different database connections easily
- Progress Tracking: Option to show progress for long-running operations
- Production Safety: Includes safety checks for production environments
- Seeding Support: Run seeders after migration/import operations
- Configurable: Customize behavior through configuration file
- Logging: Detailed logging of all operations
🚀 Installation
Requirements
- PHP 8.1 or higher
- Laravel 9.x or later
- Composer
Install via Composer
Configuration (Optional)
Publish the configuration file to customize the package behavior:
This will create a db-sync.php file in your config directory with sensible defaults.
📦 Version Compatibility
| Laravel | PHP | Package |
|---|---|---|
| 11.x | 8.2+ | ^1.0 |
| 10.x | 8.2+ | ^1.0 |
| 9.x | 8.1+ | ^1.0 |
🚀 Quick Start
Basic Usage
Run database synchronization with default settings:
Common Examples
📚 Documentation
Available Commands
Basic Command Structure
Command Options
| Option | Description | Type | Default |
|---|---|---|---|
--path |
Path to a migration file, SQL file, or directory | string |
null |
--mode |
Operation mode (see Modes section below) | string |
import |
--database |
Database connection to use | string |
config('database.default') |
--force |
Skip production confirmation | flag |
false |
--step |
Show progress for each operation | flag |
false |
--seed |
Run seeders after migration/import | flag |
false |
--no-interaction |
Disable interactive prompts | flag |
false |
Operation Modes
| Mode | Description | Use Case |
|---|---|---|
import |
Import SQL files without running migrations | Initial data import, data migration |
import-fresh |
Drop all tables and import SQL files | Fresh installation, complete database reset |
import-append |
Append SQL to existing database | Data updates, incremental imports |
migrate |
Run database migrations | Standard migration updates |
migrate-fresh |
Drop all tables and run migrations | Complete database refresh |
migrate-refresh |
Rollback and re-run all migrations | Development environment updates |
Configuration
After publishing the configuration file, you can customize the package behavior:
🛠 Advanced Usage
Using in Code
You can also use the package directly in your code:
🔒 Security
Best Practices
- Always test database operations in a development environment first
- Always take backups before running destructive operations
- Use the
--forceflag with extreme caution in production - For large databases, use
--stepto monitor progress - Review SQL files from untrusted sources before importing
- Use database transactions when possible
Reporting Security Issues
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
🤝 Contributing
Thank you for considering contributing to Laravel DB Sync! The contribution guide can be found in the CONTRIBUTING.md file.
Code of Conduct
In order to ensure that the Laravel community is welcoming to all, please review and abide by the Code of Conduct.
Testing
📄 License
Laravel DB Sync is open-sourced software licensed under the MIT license.
✨ Credits
- Dibakar
- All Contributors
🔗 Useful Links
All versions of db-sync with dependencies
illuminate/support Version ^9.0 || ^10.0 || ^11.0 || ^12.0
illuminate/console Version ^9.0 || ^10.0 || ^11.0 || ^12.0
illuminate/database Version ^9.0 || ^10.0 || ^11.0 || ^12.0