A simple console tool which helps to migrate database data from one to another using different DB connections.
Defining source and target database connection.
Allows to change target tables names and columns as well.
Transforms data for each processing rows.
When to use
Sometimes you can have an opportunity to make your custom database based on the existing one but in your opinion you can design it in better way for example primary keys are not names simply as id but in the <table_name>_id pattern, or columns values are not exactly what you want.
Add marcinkozak/databasemigrator to composer.json.
Or simply run:
composer require marcinkozak/databasemigrator
To make it available for Laravel open the config/app.php file and add line below.
'providers'=>array(// Other service providers entriesMarcinKozak\DatabaseMigrator\DatabaseMigratorServiceProvider::class,);
Let's suppose that in this case $value stores identical value as the some_column_name column. By using the array_get function we can fetch the desirable primary key and use it as foreign key for the new value inside the map method.