Download the PHP package rndwiga/laravel-multi-db-tenant without Composer

On this page you can find all versions of the php package rndwiga/laravel-multi-db-tenant. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-multi-db-tenant

Build Status

Multi-Database Tenant Package for Laravel

This package is meant for Laravel applications to help with Multi-Database Tenant Applications.

A sample laravel application that uses this package can be found at github

Installation

Add the service providers to your application providers array in config/app.php A Facade is also available and can be added...

Providers

Facade

Configuration Files

This will copy the laramultidbtenant.php configuration file into the app/config directory as well as copy the tenant, tenant_users and tenant_databases migration files needed. Create your models.

Setup the database for your Tenants in your .env files

Create the needed model classes

This will create the Tenant, TenantDatabase, TenantUser models. Make sure to provide the right relationships and don't forget to create the relationships within the User, Tenant, TenantUser and TenantDatabase models as well as set the connection properties.

Create the template, tenant migration folders as well as a tenant public folder

This package registers a middleware called authTenant within it's service provider. This is needed in order to automatically set the default connections for the Application's model

For a todo application see demo application

Inside your controllers that will control tenant specific routing, add the following to the __construct methods

also make sure to include the trait to do migrations automatically once the tenant has registered their company...

Complete namespace for this is...

Create your migration files

This assumes you have already done...

So create your migration files...

Your TenantDatabase Model

This is important

Your TenantDatabase model must implement the ITenantDatabase interface

Once that's done, start with registering a user, at least collect information needed. In your controller that registers the user, tenant, tenant_database, tenant_users you should be able to do...

Use this demo as a guide. See SessionsController@postRegister. This should show the code...

Questions

Twitter: @rndwiga254

Future

  1. Do some clean up of the code.
  2. Command for creating template and tenant migration files
  3. Command to migrate to template database
  4. Command to sync new migration files
  5. Command to copy any needed data from template database to all tenant databases
  6. Add tests

All versions of laravel-multi-db-tenant with dependencies

PHP Build Version
Package Version
Requires php Version >=5.5.9
illuminate/support Version ^5.3
illuminate/console Version ^5.3
illuminate/config Version ^5.3
vlucas/phpdotenv Version ^2.4
illuminate/database Version ^5.3
illuminate/session Version ^5.3
illuminate/auth Version ^5.3
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package rndwiga/laravel-multi-db-tenant contains the following files

Loading the files please wait ....