Download the PHP package rolice/laravel-db-switch without Composer

On this page you can find all versions of the php package rolice/laravel-db-switch. 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-db-switch

Database Switch for Laravel and Lumen

Composer package for Laravel that enables easy replacement of database instance. The package is highly suitable for similar databases that run different copies of a same program.

This package is being developed and tested under Laravel 5.3, Laravel 5.4 and Lumen 5.4. However it should be compatible with the older releases of Laravel, expecting at least as versions 5.0.

Prerequisites

Composer

You will need composer to setup your project. You can skip this point most-likely, since it is a must for your Laravel or Lumen project, but if for some reason you are new to it you will find the official composer website very useful. You will find detailed documentation, use-cases and scenarios plus full instruction set about the downloading and installing composer, including all the download files needed.

Laravel/Lumen Project

We assume you have prepared and installed already your Laravel or Lumen project and you have navigated to its folder with your console/terminal application.

Installation

The package is installed in the traditional way through composer. You can do this by executing the following command in the folder of your Laravel project:

or if you have no global composer installation exists with your project, but simply composer.phar file:

The above should add the package with your project directly.

Alternatively, you can manually add rolice/laravel-db-switch in your composer.json file in the require section and then you will be able to install it with:

or again if no global composer installation exists:

Note: That you will have to replace /path/to/composer.phar in the examples above with the actual path where you have downloaded a copy of the official composer.phar. More information could be found on the previous section with the Prerequisites.

After you are ready with the package installation we have to enable the service provider inside the application config.

For Laravel: Just open the {your/project/folder}/config/app.php file of your application (by default should be located there).

Add the service provider inside the providers section (array):

Preferably under the comment like:

For Lumen: You should register the service provider inside bootstrap/app.php like:

For Laravel: Now you can register the facade in the section below named aliases (array), in the same file config/app.php by adding the following like there:

For Lumen: You can enable facades and pass it along with:

...or you can directly enable it the same way, but with raw code, an example:

Now the package should be available and running with your project.

Usage

You can use the package service either through the facade DbSwitch or through the singleton instance inside the IoC service container of Laravel:

That is the whole scope of this package.

Enjoy switching your databases! :P


All versions of laravel-db-switch with dependencies

PHP Build Version
Package Version
Requires php Version >=5.6
illuminate/support Version ^5.2
illuminate/database Version ^5.2
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 rolice/laravel-db-switch contains the following files

Loading the files please wait ....