Giter Club home page Giter Club logo

laravel-tenant-migrate's Introduction

A2Way Laravel Tenant Migrate

A2Way Laravel Tenant Migrate is a Laravel package that can be used to migrate different databases without editing database configuration files.

This is specially useful for SaaS (Software as a Service) web applications that stores data of each tenant in different databases. Migrating databases like that can be very hard because you might have to change your database configuration for each tenant database. As you can imagine, this is not a very scalable solution.

A2Way Laravel Tenant Migrate can help you overcome this problem.

Commands Available

Installing A2Way Laravel Tenant Migrate on your Laravel project will add following commands to your artisan tool.

  • migrate:tenant (connection-name) (database-name)
  • migrate:tenant:install (connection-name) (database-name)
  • migrate:tenant:refresh (connection-name) (database-name)
  • migrate:tenant:reset (connection-name) (database-name)
  • migrate:tenant:rollback (connection-name) (database-name)

Each of above commands will perform the task of their cousin commands that has the similar name but for “tenant”. For an example, migrate:tenant:refresh myConnection myDatabase will run migrate:refresh on myDatabase, accessing it through connection details given in myConnection.

An example of usage through a controller is:

Artisan::call('migrate:tenant', [
	'connection-name' => 'mysql',
	'database-name'     => 'test',
	'--path' => 'database/migrations/tenant'
]);

Installing

  1. Issue the following command:

    composer require a2way/laravel-tenant-migrate 1.*

  2. Then add the following line to your Laravel app’s “app/config/app.php” file’s “providers” sub-array.

    A2way\LaravelTenantMigrate\LaravelTenantMigrateServiceProvider

  3. Check the installation by issuing "php artisan command". If you are able to see the above commands in your list of commands, installation was successful.

Contributing

Please read http://a2way.com/contributing/ before contributing.

laravel-tenant-migrate's People

Contributors

budhajeewa avatar marcelorl avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.