PHPackages                             marcelohoffmeister/migrator - 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. marcelohoffmeister/migrator

ActiveLibrary

marcelohoffmeister/migrator
===========================

Namespaced Migrations for Laravel 6.0+

2.0.1(6y ago)13MITPHP

Since Jun 2Pushed 6y agoCompare

[ Source](https://github.com/MarceloHoffmeister/migrator)[ Packagist](https://packagist.org/packages/marcelohoffmeister/migrator)[ RSS](/packages/marcelohoffmeister-migrator/feed)WikiDiscussions master Synced 4d ago

READMEChangelog (1)DependenciesVersions (18)Used By (0)

marcelohoffmeister/migrator
===========================

[](#marcelohoffmeistermigrator)

[![Latest Stable Version](https://camo.githubusercontent.com/5b01eaebfae6e9ff8d288c87ef8eb0405bda705a8799ef1083165c5afe2c8912/68747470733a2f2f706f7365722e707567782e6f72672f6d617263656c6f686f66666d6569737465722f6d69677261746f722f762f737461626c65)](https://packagist.org/packages/marcelohoffmeister/migrator) [![Total Downloads](https://camo.githubusercontent.com/d908ce8acc42f7fc41b74c3c0aabcdaa99a099adda4f98185845fb8cd56376fd/68747470733a2f2f706f7365722e707567782e6f72672f6d617263656c6f686f66666d6569737465722f6d69677261746f722f646f776e6c6f616473)](https://packagist.org/packages/marcelohoffmeister/migrator) [![Monthly Downloads](https://camo.githubusercontent.com/65ba5f6d9bfbb912e9015ac0190bdbdab6051cafd3b5f80e7c12b705bfdda72b/68747470733a2f2f706f7365722e707567782e6f72672f6d617263656c6f686f66666d6569737465722f6d69677261746f722f642f6d6f6e74686c79)](https://packagist.org/packages/marcelohoffmeister/migrator) [![License](https://camo.githubusercontent.com/dfa08e8a43c512551b3078ed638c392fea77edf68c9c91dac97641cf97bad8fe/68747470733a2f2f706f7365722e707567782e6f72672f6d617263656c6f686f66666d6569737465722f6d69677261746f722f6c6963656e7365)](https://packagist.org/packages/marcelohoffmeister/migrator)

This package is a customized version of Laravel's default database migrator, it was designed to register migrations on services providers and support namespacing as well.

There is no timestamp previews since the run order is based on how you register the migrations.

### Warning

[](#warning)

This Package Supports Laravel starting on 5.2 up to the latest stable version.

### Installing

[](#installing)

In order to install Migrator, run the following command into your Laravel 6.0+ project:

```
composer require marcelohoffmeister/migrator

```

After installing the Package, you can now register it's provider into your config/app.php file:

```
'providers' => [
    // other providers omitted.
  Migrator\MigrationServiceProvider::class,
]
```

And publish configuration: with

```
php artisan vendor:publish --provider="Migrator\MigrationServiceProvider"

```

### Usage

[](#usage)

As the default Laravel migrator, this one has all the original commands, to list the available options, you can see all the available options using `php artisan` command.

```
migrator            Run the database migrations
migrator:fresh      Drop all tables and re-run all migrations
migrator:install    Create the migration repository
migrator:make       Create a new migration file
migrator:refresh    Reset and re-run all migrations
migrator:reset      Rollback all database migrations
migrator:rollback   Rollback the last database migration
migrator:status     Show the status of each migration

```

#### Creating Migrations

[](#creating-migrations)

In order to generate an empty migration, please provide the migrator with the full qualified class name, as the example.

`php artisan migrator:make 'MyApp\MyModule\Database\Migrations\CreateOrdersTable' --create=orders`

This will create a migration class into the right directory, the resulting file is slightly different from the default Laravel generated:

```
