{"id":22910333,"url":"https://github.com/rokde/laravel-clone-database-command","last_synced_at":"2025-04-01T10:27:00.432Z","repository":{"id":221177286,"uuid":"753625993","full_name":"rokde/laravel-clone-database-command","owner":"rokde","description":"Clone a database with overwriting table values","archived":false,"fork":false,"pushed_at":"2024-02-06T15:55:39.000Z","size":24,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-02-07T16:17:12.721Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rokde.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null},"funding":{"github":"rokde","custom":["https://paypal.me/rok"]}},"created_at":"2024-02-06T13:50:09.000Z","updated_at":"2024-04-15T05:57:37.723Z","dependencies_parsed_at":null,"dependency_job_id":"968f337d-5c21-4795-a1b5-40c370ec4f0a","html_url":"https://github.com/rokde/laravel-clone-database-command","commit_stats":null,"previous_names":["rokde/laravel-clone-database-command"],"tags_count":1,"template":false,"template_full_name":"spatie/package-skeleton-laravel","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rokde%2Flaravel-clone-database-command","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rokde%2Flaravel-clone-database-command/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rokde%2Flaravel-clone-database-command/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rokde%2Flaravel-clone-database-command/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rokde","download_url":"https://codeload.github.com/rokde/laravel-clone-database-command/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246622425,"owners_count":20807143,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-14T03:43:02.528Z","updated_at":"2025-04-01T10:27:00.411Z","avatar_url":"https://github.com/rokde.png","language":"PHP","funding_links":["https://github.com/sponsors/rokde","https://paypal.me/rok"],"categories":[],"sub_categories":[],"readme":"# This is the laravel clone database command\n\n[![Latest Version on Packagist](https://img.shields.io/packagist/v/rokde/laravel-clone-database-command.svg?style=flat-square)](https://packagist.org/packages/rokde/laravel-clone-database-command)\n[![GitHub Tests Action Status](https://img.shields.io/github/actions/workflow/status/rokde/laravel-clone-database-command/run-tests.yml?branch=main\u0026label=tests\u0026style=flat-square)](https://github.com/rokde/laravel-clone-database-command/actions?query=workflow%3Arun-tests+branch%3Amain)\n[![GitHub Code Style Action Status](https://img.shields.io/github/actions/workflow/status/rokde/laravel-clone-database-command/fix-php-code-style-issues.yml?branch=main\u0026label=code%20style\u0026style=flat-square)](https://github.com/rokde/laravel-clone-database-command/actions?query=workflow%3A\"Fix+PHP+code+style+issues\"+branch%3Amain)\n[![Total Downloads](https://img.shields.io/packagist/dt/rokde/laravel-clone-database-command.svg?style=flat-square)](https://packagist.org/packages/rokde/laravel-clone-database-command)\n\nThis artisan command can clone a production database to development databases with overwriting some personal data as configured.\n\n## Installation\n\nYou can install the package via composer:\n\n```bash\ncomposer require rokde/laravel-clone-database-command\n```\n\n## Usage\n\nYou can use the pre-configured artisan console command:\n\n```bash\nphp artisan db:clone\n```\n\nThis assumes that there are the entries `source` and `target` in the database configuration.\n\nOtherwise you can create your own clone command to meet the configurable needs.\n\nAll single tasks can be found in the `src/Actions` folder. So you can join it like you want if necessary. \n\n### Configuration\n\nThe whole configuration is stored in a class `DatabaseSyncConfiguration`.\n\n#### source \u0026 target connection\n\nThe name of the connections and the connection configuration is editable. So if you already have a `target` or `source` connection configured - you can change that name if necessary.\n\n#### chunk size\n\nThe chunk size can be configured for a specific table or for any table.\n\n#### limit\n\nThe limit of rows can be configured for a specific table or for any table.\n\n#### mutations\n\nA mutation can be configured for a specific table or for any table. So the given column name can be used for any table when existent. So you can replace all `email` columns by a fake email like so:\n\n```php\n$config-\u003eaddMutation('email', fn() =\u003e fake()-\u003eemail);\n```\n\n#### behaviour\n\nWe can decided what to do with the tables already existing on the target: keep it as is, or drop all unhandled tables.\n\nAnother option is to delete records before inserting the new ones or should the table be dropped before and the structure should be stored newly.\n\n\n## Testing\n\n```bash\ncomposer test\n```\n\n## Changelog\n\nPlease see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.\n\n## Contributing\n\nPlease see [CONTRIBUTING](CONTRIBUTING.md) for details.\n\n## Security Vulnerabilities\n\nPlease review [our security policy](../../security/policy) on how to report security vulnerabilities.\n\n## Credits\n\n- [Robert Kummer](https://github.com/rokde)\n- [All Contributors](../../contributors)\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE.md) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frokde%2Flaravel-clone-database-command","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frokde%2Flaravel-clone-database-command","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frokde%2Flaravel-clone-database-command/lists"}