Skip to content
This repository has been archived by the owner on Sep 25, 2023. It is now read-only.

Package to help refactor data in staging and production environments.

License

Notifications You must be signed in to change notification settings

Midwestern-Interactive/laravel-refactor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

MWI Laravel Refactor

Package to help refactor data in staging and production environments.

Installation

composer require mwi/laravel-refactor
php artisan migrate

Service Provider

If you're on laravel 5.5 or later the service provider will be automatically loaded and you can skip this step, if not, add to your config/app.php providers

'providers' => [
    // ...
    MWI\LaravelRefactor\ServiceProvider::class,
    // ...
],

Usage

Once you have the package setup and migrations ran

php artisan make:refactor convert_relationship_to_many_to_many

Instruct the up and down methods

<?php

class ConvertRelationshipToManyToMany
{
    /**
     * Run the refactor.
     *
     * @return void
     */
    public function up()
    {
        //
    }

    /**
     * Reverse the refactor.
     *
     * @return void
     */
    public function down()
    {
        //
    }
}

Run the refactor command

php artisan refactor

Rollback

You can roll all migrations back

php artisan refactor --rollback

Steps

You can also run a certain number of steps

php artisan refactor --steps=2
php artisan refactor --rollback --steps=1

About

Package to help refactor data in staging and production environments.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages