Download the PHP package jsefton/migrate-environments without Composer
On this page you can find all versions of the php package jsefton/migrate-environments. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download jsefton/migrate-environments
More information about jsefton/migrate-environments
Files in jsefton/migrate-environments
Package migrate-environments
Short Description Allows you to target additional environments to run migrations
License MIT
Homepage https://github.com/jsefton/migrate-environments
Informations about the package migrate-environments
Laravel Migrate Environments
This Artisan command allows you to migrate to external or additional environments by switching out the database details in an easy to use prompt interface.
This can be useful if you external staging and production environments and need to test or run migrations against the databases.
This tool could be adapted easily to become part of a build process to automatically run, but just be wary over where you store the credentials.
The credentials are stored in a JSON file for future use within /storage/app (This should not be committed into your repository, please check your site .gitignore if it comes up).
Installation
You will need composer to install this package (get composer). Then run:
Register Service Provider
Add the below into your config/app.php
within providers
array
After installation you will need to publish the config file which will allow you to specify your own list of environments. To do this run:
This will create the file config/migrate-env.php
where you can configure your list of environments.
Usage
When in the CLI run the below to execute the command and begin the prompts
If you don't want to enter data through prompt questions, you can use arguments to pass in all the needed data. The following arguments are available:
Full usage example with arguments:
If you have saved connection details then you can save time with:
You can also run extra artisan commands such as db:seed
by selecting a task of custom
which will then prompt for the task you want to run.