PHPackages                             jsefton/migrate-environments - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. jsefton/migrate-environments

ActiveLibrary[Database &amp; ORM](/categories/database)

jsefton/migrate-environments
============================

Allows you to target additional environments to run migrations

1.2.0(8y ago)81902MITPHP

Since Aug 1Pushed 8y ago2 watchersCompare

[ Source](https://github.com/jsefton/migrate-environments)[ Packagist](https://packagist.org/packages/jsefton/migrate-environments)[ Docs](https://github.com/jsefton/migrate-environments)[ RSS](/packages/jsefton-migrate-environments/feed)WikiDiscussions master Synced yesterday

READMEChangelog (6)Dependencies (1)Versions (6)Used By (0)

Laravel 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

[](#installation)

You will need composer to install this package (get composer). Then run:

```
composer require jsefton/migrate-environments
```

#### Register Service Provider

[](#register-service-provider)

Add the below into your `config/app.php` within `providers` array

```
JSefton\MigrateEnv\MigrateEnvironmentsProvider::class

```

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:

```
php artisan vendor:publish --tag=migrate-env
```

This will create the file `config/migrate-env.php` where you can configure your list of environments.

### Usage

[](#usage)

When in the CLI run the below to execute the command and begin the prompts

```
php artisan migrate:env
```

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:

```
--env[=ENV]
--stored[=STORED]
--host[=HOST]
--database[=DATABASE]
--username[=USERNAME]
--password[=PASSWORD]
--port[=PORT]
--task[=TASK]
```

Full usage example with arguments:

```
php artisan migrate:env --env=Local --host=192.168.10.10 --database=testing --username=homestead --password=secret --task=migrate:status
```

If you have saved connection details then you can save time with:

```
php artisan migrate:env --env=Local --stored=true --task=migrate:status
```

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.

[![](https://camo.githubusercontent.com/1168b4c534b0b3bf2b84a332842f2213bb86aa96d116de8d6c6e05a0d9e8c2c7/68747470733a2f2f6a616d69652d736566746f6e2e636f2e756b2f65787465726e616c2f6d6967726174652d656e762d332e676966)](https://camo.githubusercontent.com/1168b4c534b0b3bf2b84a332842f2213bb86aa96d116de8d6c6e05a0d9e8c2c7/68747470733a2f2f6a616d69652d736566746f6e2e636f2e756b2f65787465726e616c2f6d6967726174652d656e762d332e676966)

###  Health Score

32

—

LowBetter than 69% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 97% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~52 days

Total

5

Last Release

3045d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/41b413127c7499a63bcb5c5ae903bd8961ba29300b6ccbda873e0c4bf06d0a02?d=identicon)[jsefton](/maintainers/jsefton)

---

Top Contributors

[![jsefton](https://avatars.githubusercontent.com/u/4114741?v=4)](https://github.com/jsefton "jsefton (32 commits)")[![MrRio](https://avatars.githubusercontent.com/u/47539?v=4)](https://github.com/MrRio "MrRio (1 commits)")

---

Tags

artisanenvironmentslaravelmigrationphplaravelenvironmentmigrationsmigrate

### Embed Badge

![Health badge](/badges/jsefton-migrate-environments/health.svg)

```
[![Health](https://phpackages.com/badges/jsefton-migrate-environments/health.svg)](https://phpackages.com/packages/jsefton-migrate-environments)
```

###  Alternatives

[anourvalar/eloquent-serialize

Laravel Query Builder (Eloquent) serialization

11222.5M33](/packages/anourvalar-eloquent-serialize)[dragon-code/laravel-deploy-operations

Performing any actions during the deployment process

244207.7k2](/packages/dragon-code-laravel-deploy-operations)[jaybizzle/laravel-migrations-organiser

A Laravel package to help organise migration files.

113406.2k2](/packages/jaybizzle-laravel-migrations-organiser)[umbrellio/laravel-pg-extensions

Extensions for Postgres Laravel

102443.2k1](/packages/umbrellio-laravel-pg-extensions)[statamic-rad-pack/runway

Eloquently manage your database models in Statamic.

135212.4k7](/packages/statamic-rad-pack-runway)[ramadan/easy-model

A Laravel package for enjoyably managing database queries.

111.6k](/packages/ramadan-easy-model)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
