{"id":15025134,"url":"https://github.com/thedragoncode/laravel-data-dumper","last_synced_at":"2025-04-19T04:19:17.611Z","repository":{"id":227943405,"uuid":"772438818","full_name":"TheDragonCode/laravel-data-dumper","owner":"TheDragonCode","description":"Adding data from certain tables when executing the `php artisan schema:dump` console command","archived":false,"fork":false,"pushed_at":"2025-03-02T19:21:36.000Z","size":101,"stargazers_count":34,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-12T07:21:38.097Z","etag":null,"topics":["database","database-schema","dump","dumper","laravel","laravel-framework","laravel-package","schema"],"latest_commit_sha":null,"homepage":"","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/TheDragonCode.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"publiccode":null,"codemeta":null},"funding":{"custom":["https://boosty.to/dragon-code","https://yoomoney.ru/to/410012608840929","https://www.donationalerts.com/r/dragon_code"]}},"created_at":"2024-03-15T07:35:04.000Z","updated_at":"2025-03-02T19:21:38.000Z","dependencies_parsed_at":null,"dependency_job_id":"fd2baa18-e539-4af5-b3f1-ff91e78e55eb","html_url":"https://github.com/TheDragonCode/laravel-data-dumper","commit_stats":{"total_commits":46,"total_committers":2,"mean_commits":23.0,"dds":"0.021739130434782594","last_synced_commit":"eee892339692f87820dc5ccae33e248c7492ed1c"},"previous_names":["thedragoncode/laravel-data-dumper"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheDragonCode%2Flaravel-data-dumper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheDragonCode%2Flaravel-data-dumper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheDragonCode%2Flaravel-data-dumper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheDragonCode%2Flaravel-data-dumper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TheDragonCode","download_url":"https://codeload.github.com/TheDragonCode/laravel-data-dumper/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249605992,"owners_count":21298845,"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":["database","database-schema","dump","dumper","laravel","laravel-framework","laravel-package","schema"],"created_at":"2024-09-24T20:01:33.611Z","updated_at":"2025-04-19T04:19:17.605Z","avatar_url":"https://github.com/TheDragonCode.png","language":"PHP","funding_links":["https://boosty.to/dragon-code","https://yoomoney.ru/to/410012608840929","https://www.donationalerts.com/r/dragon_code"],"categories":[],"sub_categories":[],"readme":"# Database Data Dumper for Laravel\n\n![the dragon code database data dumper](https://preview.dragon-code.pro/the-dragon-code/database-data-dumper.svg?brand=laravel)\n\n[![Stable Version][badge_stable]][link_packagist]\n[![Total Downloads][badge_downloads]][link_packagist]\n[![Github Workflow Status][badge_build]][link_build]\n[![License][badge_license]][link_license]\n\n## Introduction\n\nThe [squashing migrations](https://laravel.com/docs/migrations#squashing-migrations) in Laravel does not export data\nfrom tables?\n\nThere is a solution!\n\n### How it works?\n\nAfter installing and configuring the package, you simply run the console command `php artisan schema:dump` (with or\nwithout flags - it's up to you), and the final SQL dump file will contain the data structure including the contents of\nthe tables you specified at the configuration stage.\n\nThis will allow you to painlessly execute the `php artisan schema:dump --prune` command, which will remove unnecessary\nmigration files.\n\n## Requirements\n\n- Laravel 10, 11, 12\n- PHP 8.2 or higher\n- Databases:\n    - Sqlite 3\n    - MySQL 5.7, 8, 9\n    - PostgreSQL 12, 13, 14, 15, 16, 17\n\n## Installation\n\nTo get the latest version of `Database Data Dumper`, simply require the project\nusing [Composer](https://getcomposer.org):\n\n```Bash\ncomposer require dragon-code/laravel-data-dumper\n```\n\nOr manually update `require` block of `composer.json` and run `composer update`.\n\n```json\n{\n    \"require\": {\n        \"dragon-code/laravel-data-dumper\": \"^1.0\"\n    }\n}\n```\n\n## Configuration\n\nSince Laravel mechanism for publishing configuration files does not allow them to be merged on the fly,\na new array element must be added to the [`config/database.php`](config/settings.php) file:\n\n```php\nreturn [\n    /*\n    |--------------------------------------------------------------------------\n    | Schema Settings\n    |--------------------------------------------------------------------------\n    |\n    | This block will contain the names of the tables for which it is\n    | necessary to export data along with the table schema.\n    |\n    */\n\n    'schema' =\u003e [\n        'tables' =\u003e [\n            // 'foo',\n            // 'bar',\n            // App\\Models\\Article::class,\n\n            // 'qwerty1' =\u003e ['column_name_1', 'database/foo'],\n            // 'qwerty2' =\u003e ['column_name_2', __DIR__ . '/../bar'],\n        ],\n    ],\n];\n```\n\nAfter that, add to the array the names of the tables for which you want to export data.\n\nThat's it. Now you can run the [`php artisan schema:dump`](https://laravel.com/docs/migrations#squashing-migrations)\nconsole command and enjoy the result.\n\n\u003e [!NOTE]\n\u003e\n\u003e If you need to delete files from a folder to which a table is related (for example, the `migrations` table),\n\u003e you can specify an array of two values in the parameter, where the first element should be the name of the column\n\u003e containing the file name, and the second element should be absolute or relative folder path.\n\n\u003e [!WARNING]\n\u003e\n\u003e Laravel 11.35.2 and below does not know how to report the presence of the `--prune` parameter when calling the\n\u003e `artisan schema:dump` console command, so specifying paths to folders will always delete files from them.\n\u003e\n\u003e Starting with Laravel version 11.36, files will be deleted only when calling the console command with the\n\u003e `--prune` parameter.\n\n\n## License\n\nThis package is licensed under the [MIT License](LICENSE).\n\n\n[badge_build]:          https://img.shields.io/github/actions/workflow/status/TheDragonCode/laravel-data-dumper/tests.yml?style=flat-square\n\n[badge_downloads]:      https://img.shields.io/packagist/dt/dragon-code/laravel-data-dumper.svg?style=flat-square\n\n[badge_license]:        https://img.shields.io/packagist/l/dragon-code/laravel-data-dumper.svg?style=flat-square\n\n[badge_stable]:         https://img.shields.io/github/v/release/TheDragonCode/laravel-data-dumper?label=stable\u0026style=flat-square\n\n[link_build]:           https://github.com/TheDragonCode/laravel-data-dumper/actions\n\n[link_license]:         LICENSE\n\n[link_packagist]:       https://packagist.org/packages/dragon-code/laravel-data-dumper\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthedragoncode%2Flaravel-data-dumper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthedragoncode%2Flaravel-data-dumper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthedragoncode%2Flaravel-data-dumper/lists"}